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

Function f

imperative/python/test/unit/jit/test_tracing.py:37–45  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

35def test_trace(trace_mode, return_mode):
36 @trace(symbolic=trace_mode)
37 def f(x):
38 if return_mode == "Tuple":
39 return (-x,)
40 elif return_mode == "List":
41 return [-x]
42 elif return_mode == "Dict":
43 return {"neg": -x}
44 else:
45 return -x
46
47 def get_numpy(y):
48 if return_mode == "Tuple" or return_mode == "List":

Callers 15

test_traceFunction · 0.70
test_tensor_detachFunction · 0.70
test_exclude_from_traceFunction · 0.70
test_elemwise_fuseFunction · 0.70
test_print_in_traceFunction · 0.70
test_dumpFunction · 0.70
test_capture_dumpFunction · 0.70
test_dump_volatileFunction · 0.70
test_dump_backward_graphFunction · 0.70
test_dump_with_testcaseFunction · 0.70
test_trace_profilerFunction · 0.70

Calls 15

exclude_from_traceFunction · 0.90
expFunction · 0.90
logFunction · 0.90
isscalarFunction · 0.90
_broadcastMethod · 0.80
assert_equalMethod · 0.80
arrayMethod · 0.80
broadcast_toMethod · 0.80
forwardFunction · 0.70
detachMethod · 0.45
sumMethod · 0.45
meanMethod · 0.45

Tested by

no test coverage detected