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

Function test_broadcast

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

Source from the content-addressed store, hash-verified

284
285
286def test_broadcast():
287 x = np.arange(10).reshape(1, 10).astype("int32")
288 xx = Tensor(x)
289 (yy,) = broadcast(xx, (10, 10))
290 np.testing.assert_equal(np.repeat(x, 10, 0), yy.numpy())
291
292
293def test_subtensor():

Callers

nothing calls this directly

Calls 6

TensorClass · 0.90
assert_equalMethod · 0.80
broadcastFunction · 0.70
astypeMethod · 0.45
reshapeMethod · 0.45
numpyMethod · 0.45

Tested by

no test coverage detected