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

Method cast

imperative/python/src/tensor.h:106–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104 friend wrap_t;
105
106 inline static TensorWrapper* cast(PyObject* obj) {
107 return reinterpret_cast<wrap_t*>(obj)->inst();
108 }
109 inline static TensorWrapper* try_cast(PyObject* obj) {
110 if (!wrap_t::type().isinstance(obj))
111 return nullptr;

Callers

nothing calls this directly

Calls 1

instMethod · 0.45

Tested by

no test coverage detected