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

Function test_transpose

imperative/python/test/unit/core/test_indexing_op.py:279–283  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

277
278
279def test_transpose():
280 x = np.arange(10).reshape(2, 5).astype("int32")
281 xx = Tensor(x)
282 (yy,) = transpose(xx, pattern=[1, -1, 0])
283 np.testing.assert_equal(np.expand_dims(x.transpose(), axis=1), yy.numpy())
284
285
286def test_broadcast():

Callers

nothing calls this directly

Calls 7

TensorClass · 0.90
assert_equalMethod · 0.80
transposeFunction · 0.70
astypeMethod · 0.45
reshapeMethod · 0.45
transposeMethod · 0.45
numpyMethod · 0.45

Tested by

no test coverage detected