How to get the correct shape of the tensor in custom ...
https://discuss.pytorch.org/t/how-to-get-the-correct-shape-of-the...08.05.2020 · Hello, I am using custom Dataset class, but the problem is that when I get the data from the Dataloader I am left with array that has different tensor shape than I want. shape that I get: torch.Size([1, 56, 128, 128]) shape that I want: torch.Size([1, 56, 1, 128, 128]) my approach was to: to apply numpy.expand_dims on the array and get torch.Size([1, 1, 56, 128, 128]) then to …