When testing a network in PyTorch one can use with torch.no_grad():. What is the Libtorch (C++) equivalent? Thanks!
with torch.no_grad():
The equivalent in LibTorch is torch::NoGradGuard no_grad, see documentation.
torch::NoGradGuard no_grad
1.4m articles
1.4m replys
5 comments
57.0k users