I have a situation that I compute the weights manually and want to update the weights using those. Here is what I did:
optimizer.zero_grad()
param.grad = Variable(grad_tensor)
optimizer.step()

But the weights are not updated, is there something I’m missing?