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

Method children

imperative/python/megengine/module/module.py:332–338  ·  view source on GitHub ↗

r"""Returns an iterable for all the submodules that are direct attributes of this module.

(self, **kwargs)

Source from the content-addressed store, hash-verified

330 )
331
332 def children(self, **kwargs) -> "Iterable[Module]":
333 r"""Returns an iterable for all the submodules that are direct attributes of this
334 module.
335 """
336 yield from self._flatten(
337 with_key=False, predicate=_is_module, recursive=False, **kwargs
338 )
339
340 def named_children(self, **kwargs) -> "Iterable[Tuple[str, Module]]":
341 r"""Returns an iterable of key-submodule pairs for all the submodules that are

Callers 1

test_module_apiFunction · 0.45

Calls 1

_flattenMethod · 0.95

Tested by 1

test_module_apiFunction · 0.36