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

Function repr_pyobj

imperative/python/src/helper.cpp:66–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64namespace {
65
66std::string repr_pyobj(PyObject* obj) {
67 if (!obj)
68 return "<null PyObject>";
69 PYTHON_GIL;
70 auto str = PyObject_Repr(obj);
71 if (!str)
72 return ssprintf("<PyObject at %p (repr failed)>", obj);
73 std::string ret{PyUnicode_AsUTF8(str)};
74 Py_DECREF(str);
75 return ret;
76}
77
78template <typename T>
79std::string typeid_name(const T& t) {

Callers 6

dtype_np2mgb_rawFunction · 0.85
np2tensor_try_borrowFunction · 0.85
np2tensorFunction · 0.85
dtype_np2mgbFunction · 0.85
to_mgb_supported_dtypeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected