Caffe2 - C++ API
A deep learning, cross platform ML framework
python_anomaly_mode.h
1 #pragma once
2 
3 #include <torch/csrc/autograd/anomaly_mode.h>
4 #include <torch/csrc/python_headers.h>
5 #include <torch/csrc/utils/auto_gil.h>
6 
7 namespace torch { namespace autograd {
8 
10  static constexpr char* ANOMALY_TRACE_KEY = "traceback_";
11 
13  AutoGIL gil;
14  dict_ = PyDict_New();
15  }
16  ~PyAnomalyMetadata() override {
17  AutoGIL gil;
18  Py_DECREF(dict_);
19  }
20  void store_stack() override;
21  void print_stack() override;
22 
23  PyObject* dict() {
24  return dict_;
25  }
26 
27 private:
28  PyObject* dict_;
29 };
30 
31 }}
Definition: jit_type.h:17