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

Function is_scalar

imperative/python/src/tensor_utils.cpp:249–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249bool is_scalar(PyObject* tensor) {
250 auto* tw = TensorWrapper::try_cast(tensor);
251 if (tw) {
252 return tw->m_tensor->is_scalar();
253 }
254 return PyArray_CheckAnyScalar(tensor);
255}
256
257bool is_bool_list(PyObject* arg) {
258 if (!PyList_Check(arg)) {

Callers 5

_unpack_indexesFunction · 0.85
subtensor_fastpathFunction · 0.85
_fastpath_getitem_cppFunction · 0.85
broadcastMethod · 0.85

Calls 2

try_castFunction · 0.85
is_scalarMethod · 0.45

Tested by

no test coverage detected