Here is the original image (x), it’s a Float Tensor RGB with values between 0 and 1, just read from the dataset.
This is how i perform the permute:
permute = [ 2, 1, 0]
x = x[permute, :, :]* 255.
torch.save(x, os.path.join(opt.outf, 'patchclean.pth'))