Solved by ptrblck in post #2 
              
              
                It seems that this line of code is causing the error, as the target will be transformed to an int. 
As a workaround you could pass a target_transform and transform the target back to a tensor via: 
mnist = torchvision.datasets.MNIST(
    root=DATASET_DIR, train=True, download=True, transform=transfo…