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

Method __init__

imperative/python/megengine/traced_module/pytree.py:240–244  ·  view source on GitHub ↗
(self, type, aux_data, children_defs)

Source from the content-addressed store, hash-verified

238 """
239
240 def __init__(self, type, aux_data, children_defs):
241 self.type = type
242 self.aux_data = aux_data
243 self.children_defs = children_defs
244 self.num_leaves = sum(ch.num_leaves for ch in children_defs)
245
246 def unflatten(self, leaves):
247 r"""Given a list of values and a ``TreeDef``, builds a pytree.

Callers 1

__init__Method · 0.45

Calls 1

sumFunction · 0.85

Tested by

no test coverage detected