MCPcopy 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
18def 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
25def test_max():

Callers

nothing calls this directly

Calls 3

reshapeMethod · 0.95
TensorClass · 0.90
sumMethod · 0.45

Tested by

no test coverage detected