I think the latest version in GitHub differs in terms of those codepaths. Scale is now obsoleted by Resize . There’s also ToPILImage() in transforms that you can use to convert from a Torch tensor or ndarray to PIL Image.