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

Method __init__

imperative/python/megengine/traced_module/expr.py:731–745  ·  view source on GitHub ↗
(self, c, name: str = "", qualname: str = "")

Source from the content-addressed store, hash-verified

729 _constant_cache = {}
730
731 def __init__(self, c, name: str = "", qualname: str = ""):
732 super().__init__()
733 assert isinstance(c, (RawTensor, Module))
734 if isinstance(c, Module):
735 assert module_tracer.is_builtin(c) or c.is_qat
736 if type(c) is RawTensor:
737 with _exclude_from_trace():
738 c = Tensor(c)
739 self.value = c
740 self.name = name
741 self.inputs = []
742 node_cls = NodeMixin.get_wrapped_type(c)
743 self.outputs = [
744 node_cls(self, name=name, qualname=qualname),
745 ]
746
747 @classmethod
748 def make(cls, *args, **kwargs):

Callers

nothing calls this directly

Calls 5

_exclude_from_traceFunction · 0.85
is_builtinMethod · 0.80
get_wrapped_typeMethod · 0.80
TensorClass · 0.50
__init__Method · 0.45

Tested by

no test coverage detected