Ho you want less precision? 
I think pytorch is quite different than Caffe and you might want to implement your modification differently than you used to. Why not write it as a python function that modifies how the adam optimizer works?