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

Function cast

imperative/python/src/ops.cpp:254–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

252 return false;
253 }
254 static PyObject* cast(const T& value) {
255 auto v = static_cast<std::underlying_type_t<T>>(value);
256 mgb_assert(v <= EnumTrait<T>::max);
257 PyObject* obj = pyobj_insts[v];
258 Py_INCREF(obj);
259 return obj;
260 }
261};
262
263template <typename T>

Callers 15

_unwrap_funcFunction · 0.85
init_graph_rtFunction · 0.85
dtypeMethod · 0.85
deviceMethod · 0.85
formatMethod · 0.85
_dev_tensorMethod · 0.85
value_idMethod · 0.85
_varMethod · 0.85
_graphMethod · 0.85
init_tensorFunction · 0.85
enterMethod · 0.85
dumpMethod · 0.85

Calls

no outgoing calls

Tested by 3

arrayFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68