| 621 | } |
| 622 | |
| 623 | PyObject* TensorWrapper::module_trace_info() { |
| 624 | if (auto module_trace_info = |
| 625 | ModuleTraceTransformation::module_trace_info_map.try_get( |
| 626 | m_tensor->data())) { |
| 627 | if (module_trace_info->ptr()) { |
| 628 | return module_trace_info->inc_ref().ptr(); |
| 629 | } |
| 630 | } |
| 631 | PyErr_SetString( |
| 632 | PyExc_AttributeError, |
| 633 | "Has no attribute named \'_NodeMixin__node\', please " |
| 634 | "set it first"); |
| 635 | return nullptr; |
| 636 | } |
| 637 | |
| 638 | void TensorWrapper::set_module_trace_info(PyObject* obj) { |
| 639 | // TODO: erase when obj == nullptr |