Solved by Pranavan_Theivendira in post #2 
              
              
                Hi Luca Xin, 
Tried in GPU as well as CPU. In either ways, this code works perfect from my side.  My concern is that you are using a very old version of PyTorch and Torch Vision. In my case, I am using torch - 1.1.0 and torchvision- 0.3.0. If you can upgrade these two libraries to latest version, y…