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

Function test_norm

imperative/python/test/unit/functional/test_math.py:136–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

134
135
136def test_norm():
137 x = Tensor(np.arange(1, 7, dtype=np.int32).reshape(2, 3))
138 y = F.norm(x, axis=-1)
139 np.testing.assert_equal(
140 y.numpy().round(decimals=3), np.array([3.742, 8.775]).astype(np.float32)
141 )
142
143
144def test_sqrt():

Callers

nothing calls this directly

Calls 7

TensorClass · 0.90
assert_equalMethod · 0.80
arrayMethod · 0.80
reshapeMethod · 0.45
roundMethod · 0.45
numpyMethod · 0.45
astypeMethod · 0.45

Tested by

no test coverage detected