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

Function check

imperative/python/test/unit/core/test_autodiff.py:177–189  ·  view source on GitHub ↗
(f)

Source from the content-addressed store, hash-verified

175
176def test_release():
177 def check(f):
178 n = 0
179 d = None
180 gc.disable()
181 try:
182 for i in range(3):
183 f()
184 m = len(gc.get_objects())
185 d = m - n
186 n = m
187 assert d == 0
188 finally:
189 gc.enable()
190
191 x = mge.Tensor([0.0])
192 dy = mge.Tensor(np.ones_like(x.numpy()))

Callers

nothing calls this directly

Calls 3

fFunction · 0.70
disableMethod · 0.45
enableMethod · 0.45

Tested by

no test coverage detected