Thanks @albanD, @shane-carroll!
torch::NoGradGuard no_grad_guard works!
Memory usage is also over 2x less, which makes sense.
This really ought to be in the “getting started” docs. I’ll try and find time to make a little PR that includes this in the documentation.