Hi again,
I did some checking on my side and these are my observations:

Made sure that all the tensors are wrapped inside variables to make sure the backprop function has context of history
Checked param.grad for each of the model parameters. These turned out to be really really small numbers. Order of 10^-18
Checked values of model.parameters() before and after calling “loss.backward() and optimizer.step()”. No change. Implying that backpropogation is not happening. Or it is happening and the gradient values are so small that there is not change in weights. (learning rate = 0.001 btw)

Could this be the case of vanishing gradients? LSTMs don’t have that problem right?
Please suggest solutions.