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

Method cast

imperative/python/src/backtrace.h:66–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64 friend wrap_t;
65
66 inline static TraceKeyWrapper* cast(PyObject* obj) {
67 return reinterpret_cast<wrap_t*>(obj)->inst();
68 }
69 inline static TraceKeyWrapper* try_cast(PyObject* obj) {
70 if (obj == NULL || !wrap_t::type().isinstance(obj))
71 return nullptr;

Callers

nothing calls this directly

Calls 1

instMethod · 0.45

Tested by

no test coverage detected