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

Function test_drop_basic

imperative/python/test/unit/core/test_interpreter.py:59–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57
58
59def test_drop_basic():
60 set_option("enable_drop", True)
61 # test xpu compute
62 x = mge.tensor(np.ones((3, 3)), dtype=np.float32)
63 y = mge.tensor(np.ones((3, 3)), dtype=np.float32)
64 z = x + y
65 z._drop()
66 z.numpy()
67 # test host value compute
68 x = mge.tensor(np.ones((2, 2)), dtype=np.float32)
69 y = mge.tensor(np.ones((2, 2)), dtype=np.float32)
70 z = x + y
71 z._drop()
72 z.numpy()
73 set_option("enable_drop", False)
74
75
76def test_finalize():

Callers

nothing calls this directly

Calls 5

set_optionFunction · 0.85
tensorMethod · 0.80
onesMethod · 0.80
_dropMethod · 0.80
numpyMethod · 0.45

Tested by

no test coverage detected