MCPcopy Create free account
hub / github.com/QWTforGithub/T2LDM / _module_list

Function _module_list

timm/models/features.py:121–132  ·  view source on GitHub ↗
(module, flatten_sequential=False)

Source from the content-addressed store, hash-verified

119
120
121def _module_list(module, flatten_sequential=False):
122 # a yield/iter would be better for this but wouldn't be compatible with torchscript
123 ml = []
124 for name, module in module.named_children():
125 if flatten_sequential and isinstance(module, nn.Sequential):
126 # first level of Sequential containers is flattened into containing model
127 for child_name, child_module in module.named_children():
128 combined = [name, child_name]
129 ml.append(('_'.join(combined), '.'.join(combined), child_module))
130 else:
131 ml.append((name, name, module))
132 return ml
133
134
135def _get_feature_info(net, out_indices):

Callers 2

__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected