MD98
MD98

Reputation: 374

What is the LibTorch equivalent to PyTorch's torch.no_grad?

When testing a network in PyTorch one can use with torch.no_grad():. What is the Libtorch (C++) equivalent? Thanks!

Upvotes: 9

Views: 3889

Answers (1)

Ivan
Ivan

Reputation: 40768

The equivalent in LibTorch is torch::NoGradGuard no_grad, see documentation.

Upvotes: 11

Related Questions