Function tch::no_grad

source ·
pub fn no_grad<T, F>(f: F) -> T
where F: FnOnce() -> T,
Expand description

Runs a closure without keeping track of gradients.