I have a situation where I do:
opt = optim.Adam(model.parameters(), lr = 0.001)
out = model(input)
out.backward()
opt.step()

when I look at the model parameters, they do have non-zero gradients, but opt.step() does not update the parameters. What would I look for in this type of situation?
I should mention that I override the model.parameters() function to return an array of two specific parameters (because my model does some custom stuff that is not in any of the standard layers).