diff --git a/mmedit/models/common/downsample.py b/mmedit/models/common/downsample.py index 58979f435d..36b6d191ca 100644 --- a/mmedit/models/common/downsample.py +++ b/mmedit/models/common/downsample.py @@ -1,7 +1,4 @@ # Copyright (c) OpenMMLab. All rights reserved. -import torch - - def pixel_unshuffle(x, scale): """Down-sample by pixel unshuffle. @@ -20,7 +17,6 @@ def pixel_unshuffle(x, scale): f'with shape: {x.shape}') h = h // scale w = w // scale - size = torch.Size([b, c, h, scale, w, scale]) - x = x.view(size) + x = x.view([b, c, h, scale, w, scale]) x = x.permute(0, 1, 3, 5, 2, 4) return x.reshape(b, -1, h, w)