简体   繁体   中英

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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM