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

Function run_test

imperative/python/test/unit/functional/test_elemwise.py:297–306  ·  view source on GitHub ↗
(func, args, ref_shape, is_trace, sym=False)

Source from the content-addressed store, hash-verified

295 raise NotImplementedError("nargs {}".format(nargs))
296
297 def run_test(func, args, ref_shape, is_trace, sym=False):
298 args = [tensor(t, dtype="float32") for t in args]
299 if is_trace:
300 func = trace(symbolic=sym)(func)
301 for _ in range(3):
302 out = func(*args)
303 assert out.numpy().shape == ref_shape
304 else:
305 out = func(*args)
306 assert out.numpy().shape == ref_shape, out.numpy().shape
307
308 inps = [
309 np.array([]).astype("float32"),

Callers 1

test_empty_tensorFunction · 0.70

Calls 3

traceClass · 0.90
funcFunction · 0.70
numpyMethod · 0.45

Tested by

no test coverage detected