I believe the issue is in line 88-89 of the functional definition of the ToTensor operation. 44.
# yikes, this transpose takes 80% of the loading time/CPU
img = img.transpose(0, 1).transpose(0, 2).contiguous()