Thanks for reply and sorry I forgot it, Actually I was working in colab, and probably the files are not saved immediately there, so t was not working then, After sometime,on  reloading the page I got it. My model has returned two values ,the last layer before output was encoder layer, so I took the mean std dev and finally concatenated them, then these two values are passed through the final linear layer.