Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
31
def
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
40
def
opr_test(
Callers
5
test_matmul
Function · 0.90
test_set_subtensor
Function · 0.90
test_condtake
Function · 0.90
test_utils_astensor1d
Function · 0.90
_default_compare_fn
Function · 0.85
Calls
5
get_value
Method · 0.95
OutputNode
Class · 0.90
execute
Method · 0.45
compile
Method · 0.45
numpy
Method · 0.45
Tested by
4
test_matmul
Function · 0.72
test_set_subtensor
Function · 0.72
test_condtake
Function · 0.72
test_utils_astensor1d
Function · 0.72