Hi,
All the computations are done in this file: https://github.com/pytorch/pytorch/blob/master/torch/optim/adam.py 21
If you just want to increase the precision, you don’t have to change any cpp code. You can make your own adam optimizer (copy paste the code from the file above), and convert Tensors from single precision to double precision with .double() to increase the precision of all operations that will happen to it.
Don’t forget to convert it back to a single precision Tensor with .float() before performing the update on the original parameters.