MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / module_trace_info

Method module_trace_info

imperative/python/src/tensor.cpp:623–636  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

621}
622
623PyObject* 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
638void TensorWrapper::set_module_trace_info(PyObject* obj) {
639 // TODO: erase when obj == nullptr

Callers

nothing calls this directly

Calls 4

try_getMethod · 0.80
inc_refMethod · 0.80
dataMethod · 0.45
ptrMethod · 0.45

Tested by

no test coverage detected