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

Method _wrap

imperative/python/megengine/core/tensor/megbrain_graph.py:41–50  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

39 self._future = None
40
41 def _wrap(self, obj):
42 if type(obj) is _imperative_rt.VarNode:
43 wrapper, cache = VarNode, self._var_cache
44 elif type(obj) is _imperative_rt.OperatorNode:
45 wrapper, cache = OpNode, self._op_cache
46 else:
47 raise TypeError(type(obj))
48 if obj not in cache:
49 cache[obj] = wrapper(obj)
50 return cache[obj]
51
52 def _set_priority_to_id(self, dest_vars):
53 set_priority_to_id(_unwrap(dest_vars))

Callers 5

make_constMethod · 0.95
make_h2dMethod · 0.95
opMethod · 0.80
_wrapFunction · 0.80

Calls 1

wrapperFunction · 0.50

Tested by

no test coverage detected