pub fn no_grad<T, F>(f: F) -> Twhere F: FnOnce() -> T,
Runs a closure without keeping track of gradients.