Solved by rickantonais in post #3 
              
              
                Thank you for your answer! 
The code comes from the official PyTorch training a classifier tutorial here 
EDIT : Just found the mistake… 
In the code below, I’ve not put “()” after the function ToTensor 
transform = transforms.Compose([transforms.ToTensor, 
                               transforms.…