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

Function py_get_scope

imperative/python/src/ops.cpp:160–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158std::unordered_map<mgb::Typeinfo*, PyTypeObject*> PyOp(OpDef)::ctype2pytype;
159
160PyObject* py_get_scope(PyObject* obj, void* /* closure */) {
161 return py::cast(reinterpret_cast<PyOp(OpDef)*>(obj)->op->scope()).release().ptr();
162}
163
164int py_set_scope(PyObject* obj, PyObject* value, void* /* closure */) {
165 if (value == NULL) {

Callers

nothing calls this directly

Calls 4

castFunction · 0.85
scopeMethod · 0.80
ptrMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected