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

Function test_trace_naming

imperative/python/test/unit/jit/test_tracing.py:760–776  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

758
759
760def test_trace_naming():
761 @trace(symbolic=True, capture_as_const=True)
762 def func(x):
763 return F.max(x, axis=2, keepdims=False) + 1
764
765 inp = tensor(np.random.random((1, 3, 3, 3)))
766 func(inp)
767 file = io.BytesIO()
768 func.dump(file, optimize_for_inference=False)
769 file.seek(0)
770 import megengine.utils.network as network
771
772 net = network.Network.load(file)
773 names = set()
774 for var in net.all_vars:
775 assert var.name not in names
776 names.add(var.name)
777
778
779def test_invalid_inp_error():

Callers

nothing calls this directly

Calls 5

funcFunction · 0.70
dumpMethod · 0.45
seekMethod · 0.45
loadMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected