Hi, I think you should be able to use PyTorch’s backward to do the ordinary backprop steps in the revnet algorithm.  Probably you will need to set requires_grad back to True on the variables you are computing grad for.  I think if you try to do this and run into a stumbling block, you can repost and maybe you will get more response.