Solved by ptrblck in post #4 
              
              
                Yes, but I would recommend to specify the dimension via tensor.squeeze(0) to make sure no other dimensions are removed in case they have a size of 1.
I don’t know which PyTorch version was originally used, but I thought t() did not work on >2D data. In any case, use tensor = tensor.permute(1, 2, 0) …