3.1.6. unit_scaling.DepthModuleList
- class unit_scaling.DepthModuleList(modules: Iterable[Module])[source]
A
torch.nn.ModuleList
that automatically configures the depth for sake of scaling. Note that this does not track depth changes caused by modifications after initial construction.ModuleList
can be indexed like a regular Python list, but modules it contains are properly registered, and will be visible by allModule
methods.- Parameters:
modules (iterable?) – an iterable of modules to add
- append(module: Module) ModuleList
Append a given module to the end of the list.
- Parameters:
module (nn.Module) – module to append