Hi,
All the optimizers in torch.optim do not perform their updates in a differentiable manner.
Similarly, all the layers in nn contain nn.Parameter() that are leaf Tensors. Meaning they cannot have gradient history and so you cannot propagate gradients through their update.
I would recommend checking the higher 1 library from FAIR that does this though.