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

Function isscalar

imperative/python/megengine/core/tensor/utils.py:81–86  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

79
80
81def isscalar(x):
82
83 if isinstance(x, Tensor):
84 return x._isscalar()
85
86 return np.isscalar(x)
87
88
89def astensor1d(x, *reference, dtype=None, device=None):

Callers 1

fFunction · 0.90

Calls 1

isscalarMethod · 0.80

Tested by 1

fFunction · 0.72