MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ClassName

Function ClassName

tensorflow/python/lib/core/py_util.cc:32–46  ·  view source on GitHub ↗

py.__class__.__name__

Source from the content-addressed store, hash-verified

30
31// py.__class__.__name__
32const char* ClassName(PyObject* py) {
33/* PyPy doesn't have a separate C API for old-style classes. */
34#if PY_MAJOR_VERSION < 3 && !defined(PYPY_VERSION)
35 if (PyClass_Check(py))
36 return PyString_AS_STRING(
37 CHECK_NOTNULL(reinterpret_cast<PyClassObject*>(py)->cl_name));
38 if (PyInstance_Check(py))
39 return PyString_AS_STRING(CHECK_NOTNULL(
40 reinterpret_cast<PyInstanceObject*>(py)->in_class->cl_name));
41#endif
42 if (Py_TYPE(py) == &PyType_Type) {
43 return reinterpret_cast<PyTypeObject*>(py)->tp_name;
44 }
45 return Py_TYPE(py)->tp_name;
46}
47
48} // end namespace
49

Callers 1

PyExceptionFetchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected