Closed paulgavrikov closed 2 years ago
Hello,
This doesn't change the shape of the tensor but it does change its strides. In other words, It doesn't change how you use it as a developer but it does change how it is stored in memory. channel_last will provide better performance on modern GPUs. For this reason we use it by default. It should not change anything for you other than improved performance.
Please refer to pytorch's documentation about channel_last for more details: https://pytorch.org/tutorials/intermediate/memory_format_tutorial.html
Hi, thank you for this very interesting library. I have a question regarding the cifar10 example you provide. In your transformation pipeline I find the following:
Now, it seems to me as if
ToTorchImage()
would change the order back to the regular torch format, which I also verified by outputting the shape of the loaded batch.And then your load your model and add
.to(memory_format=torch.channels_last).cuda()
. At least on my machine this does not change anything at all. However, I have to add that I never tried channels last order.The code works, but it seems to me like everything is in regular torch order. Am I missing something?
I followed your conda env guideline: