Context management in libtorch

In pytorch, we can use with torch.no_grad() to realize context management. Is there a similar method in Libtorch in C++ ? Thanks!

NoGradGuard should do the same as with torch.no_grad() as explained here.

Thanks a lot, I will try it.