Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/MegEngine/MegEngine
/ test_sum
Function
test_sum
imperative/python/test/unit/core/test_zero_dim_tensor.py:18–22 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
16
17
18
def
test_sum():
19
a = Tensor([1, 2])
20
a = a.reshape((1, 2))
21
assert a.sum().ndim == 0
22
assert a.sum(axis=1).ndim == 1
23
24
25
def
test_max():
Callers
nothing calls this directly
Calls
3
reshape
Method · 0.95
Tensor
Class · 0.90
sum
Method · 0.45
Tested by
no test coverage detected