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

Method __init__

imperative/python/megengine/traced_module/pytree.py:321–326  ·  view source on GitHub ↗
(self, type)

Source from the content-addressed store, hash-verified

319
320class LeafDef(TreeDef):
321 def __init__(self, type):
322 if not isinstance(type, collections.abc.Sequence):
323 type = (type,)
324 super().__init__(type, None, [])
325 self.num_leaves = 1
326 self.const_val = None
327
328 def unflatten(self, leaves):
329 assert len(leaves) == 1

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected