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

Function run_test

imperative/python/test/unit/core/test_indexing_op.py:639–645  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

637 mge_x = megengine.tensor(np_x)
638
639 def run_test(fn):
640 out_ref = fn(np_x)
641 if symbolic is not None:
642 fn = jit.trace(symbolic=symbolic)(fn)
643 for i in range(3):
644 out = fn(mge_x)
645 np.testing.assert_equal(out.numpy(), out_ref)
646
647 run_test(lambda x: x[0:1, :, :])
648 run_test(lambda x: x[1:100:2, :, :])

Calls 6

TensorClass · 0.90
assert_equalMethod · 0.80
tensorMethod · 0.80
fnFunction · 0.50
numpyMethod · 0.45
astypeMethod · 0.45

Tested by

no test coverage detected