Skip to content

Add argument to children() to yield names of the modules as well #864

@fmassa

Description

@fmassa

Currently, in order to selectively iterate through the modules in a network, we need to do something like

for name, module in model._modules.items():
    if name in KEEP_LIST:
        ...

It would be good to add an option to .children() (and eventually to .modules() as well) to yield the name of the modules as well. Maybe something like .children(named=True)?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions