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

Function get_var_value

imperative/python/test/helpers/utils.py:31–37  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

29
30
31def get_var_value(x):
32 try:
33 o = OutputNode(x.var)
34 o.graph.compile(o.outputs).execute()
35 return o.get_value().numpy()
36 except RuntimeError:
37 raise ValueError("value invalid!")
38
39
40def opr_test(

Callers 5

test_matmulFunction · 0.90
test_set_subtensorFunction · 0.90
test_condtakeFunction · 0.90
test_utils_astensor1dFunction · 0.90
_default_compare_fnFunction · 0.85

Calls 5

get_valueMethod · 0.95
OutputNodeClass · 0.90
executeMethod · 0.45
compileMethod · 0.45
numpyMethod · 0.45

Tested by 4

test_matmulFunction · 0.72
test_set_subtensorFunction · 0.72
test_condtakeFunction · 0.72
test_utils_astensor1dFunction · 0.72