Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
81
def
isscalar(x):
82
83
if
isinstance(x, Tensor):
84
return
x._isscalar()
85
86
return
np.isscalar(x)
87
88
89
def
astensor1d(x, *reference, dtype=None, device=None):
Callers
1
f
Function · 0.90
Calls
1
isscalar
Method · 0.80
Tested by
1
f
Function · 0.72