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

Method interpret

imperative/python/megengine/traced_module/expr.py:468–480  ·  view source on GitHub ↗
(self, *inputs)

Source from the content-addressed store, hash-verified

466 return None
467
468 def interpret(self, *inputs):
469 args, kwargs = self.unflatten_args(inputs)
470 obj = args[0]
471 meth = getattr(obj, self.method)
472 if inspect.ismethod(meth):
473 args = args[1:]
474 outputs = getattr(obj, self.method)(*args, **kwargs)
475 if self.method == "__setitem__":
476 outputs = obj
477 if outputs is None:
478 return outputs
479 outputs, _ = tree_flatten(outputs, is_leaf=lambda x: isinstance(x, RawTensor))
480 return outputs
481
482 def _get_func(self):
483 if isinstance(self.args[0], type):

Callers

nothing calls this directly

Calls 2

tree_flattenFunction · 0.85
unflatten_argsMethod · 0.80

Tested by

no test coverage detected