The method in the following two papers, as well as the corresponding github link use second order gradients in this way.

https://arxiv.org/abs/1703.03400 5
https://arxiv.org/abs/1803.09050 4

I think the torchmeta library in this link is doing something in the background to allow this to happen, but I can’t see where the disconnect is and why my own code never seems to recognize the second order gradients when I think it should

https://github.com/tristandeleu/pytorch-meta/blob/master/examples/maml/train.py#L67 7