Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
286
def
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
293
def
test_subtensor():
Callers
nothing calls this directly
Calls
6
Tensor
Class · 0.90
assert_equal
Method · 0.80
broadcast
Function · 0.70
astype
Method · 0.45
reshape
Method · 0.45
numpy
Method · 0.45
Tested by
no test coverage detected