But for 2D tensors, the transforms.ToPILImage() and transforms.ToTensor() are needed. Also, for 2D tensor returns float32 while 3D tensor returns float64 after respective transformation.
Thanks for your contribution.