Transformations accepting tensors were added in 0.8.0 as stated in the release notes 2, so I guess your VS environment might use the latest torchvision release, while your Jupyter env might use an older one.