Caffe2 - C++ API
A deep learning, cross platform ML framework
grad_mode.cpp
1 #include <torch/csrc/autograd/grad_mode.h>
2 
3 namespace torch { namespace autograd {
4 
5 thread_local bool GradMode_enabled = true;
6 
7 bool GradMode::is_enabled() {
8  return GradMode_enabled;
9 }
10 
11 void GradMode::set_enabled(bool enabled) {
12  GradMode_enabled = enabled;
13 }
14 }}
Definition: jit_type.h:17