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

Function get_value

imperative/python/test/unit/core/test_indexing_op.py:400–408  ·  view source on GitHub ↗
(x)

Source from the content-addressed store, hash-verified

398
399# high level
400def get_value(x):
401 if isinstance(x, VarNode):
402 var = x.var
403 o = G.OutputNode(var)
404 graph = x.graph
405 graph.compile(o.outputs).execute()
406 return o.get_value().numpy()
407 else:
408 return x.numpy()
409
410
411@pytest.mark.parametrize("test_varnode", [True, False])

Callers 3

ImplMethod · 0.85

Calls 4

get_valueMethod · 0.95
executeMethod · 0.45
compileMethod · 0.45
numpyMethod · 0.45

Tested by

no test coverage detected