Thanks very much for the reply.
the input size of each image is (224, 224, 3).
I tried changing the code to----  data = data.view(-1, 224, 224, 3)
I get the following error.
RuntimeError: size mismatch, m1: [32 x 2016], m2: [150528 x 1536] at /opt/conda/conda-bld/pytorch_1587428398394/work/aten/src/THC/generic/THCTensorMathBlas.cu:283
Initially it was giving me this error . Hence to abovid the above error  i changed the line – data = data.view(1, -1).
But then it gives other error.
You think we can resolve this?
Thanks & Regards
Shravan