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

Method py_repr

imperative/python/src/ops.cpp:151–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149 static Py_hash_t tp_hash(PyObject* obj);
150 static PyObject* tp_richcompare(PyObject* self, PyObject* other, int op);
151 static PyObject* py_repr(PyObject* self) {
152 return py::cast(reinterpret_cast<PyOpDef*>(self)->op->make_name())
153 .release()
154 .ptr();
155 }
156};
157PyTypeObject PyOpType(OpDef);
158std::unordered_map<mgb::Typeinfo*, PyTypeObject*> PyOp(OpDef)::ctype2pytype;

Callers

nothing calls this directly

Calls 4

castFunction · 0.85
ptrMethod · 0.45
releaseMethod · 0.45
make_nameMethod · 0.45

Tested by

no test coverage detected