But the code version is very old and I’m not sure if it’s the correct way to do it. Anyone knows how to implement the GP elegantly using latest version? Thanks in advance.
Not yet. But I’ve noticed that the doc (https://pytorch.org/docs/stable/autograd.html) says about the parameter create_graph “Note that in nearly all cases setting this option to True is not needed and often can be worked around in a much more efficient way”, so I’m wandering if there’s a better way to do it.