Solved by tom in post #2 
              
              
                PyTorch uses CHW format (channels first), Matplotlib expects HWC, so you need to permute the image instead of using reshape. .permute(1, 2, 0) should do the trick. 
reshape does not rearrange your data in memory, it just changes where PyTorch thinks after how many items in memory it should start the…