def resize(m, target_shape): m = ToPILImage()(m.cpu().to(torch.float32)) m = Resize(target_shape)(m) m = ToTensor()(m) return m.cuda()
def resize(x, target_shape): x = ToPILImage()(x.cpu().to(torch.float32)) x = Resize(target_shape)(x) x = ToTensor()(x) return x.cuda()