@ptrblck
Thank you for your reply.
I think I solved this problem by checking out the document.
What I was doing was, giving softmax activation to the output of the VAE model even though
nn.CrossEntropyLoss consist of nn.LogSoftmax()  and  nn.NLLLoss().
Thank you anyway