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

Function get_param

imperative/python/test/helpers/utils.py:84–99  ·  view source on GitHub ↗
(cases, idx)

Source from the content-addressed store, hash-verified

82 compare_fn(r, e)
83
84 def get_param(cases, idx):
85 case = cases[idx]
86 inp = case.get("input", None)
87 outp = case.get("output", None)
88 if inp is None:
89 raise ValueError("the test case should have input")
90 if not isinstance(inp, (tuple, list)):
91 inp = (inp,)
92 if ref_fn is not None and callable(ref_fn):
93 outp = ref_fn(*inp)
94 if outp is None:
95 raise ValueError("the test case should have output or reference function")
96 if not isinstance(outp, (tuple, list)):
97 outp = (outp,)
98
99 return inp, outp
100
101 def run_index(index):
102 inp, outp = get_param(cases, index)

Callers 1

run_indexFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected