returnn.frontend.container

container functions

class returnn.frontend.container.ModuleList(*modules: __ModT | Iterable[__ModT] | Dict[str, __ModT] | ModuleList)[source]

Module list, getting passed an Iterable of Modules and creates a list of Modules in that order

By convention, any options to the module are passed to __init__, and potential changing inputs (other tensors) are passed to __call__().

append(module: __ModT) ModuleList[__ModT][source]

appends one module to the list

extend(modules: Iterable[__ModT]) ModuleList[__ModT][source]

appends multiple modules to the list

items() Iterable[Tuple[str, __ModT]][source]

module items

class returnn.frontend.container.Sequential(*modules: __ModT | Iterable[__ModT] | Dict[str, __ModT] | ModuleList)[source]

Sequential Module, takes callable of Modules which are then executed in sequence

By convention, any options to the module are passed to __init__, and potential changing inputs (other tensors) are passed to __call__().

returnn.frontend.container.sequential(source: Tensor, *modules) Tensor[source]

Wraps Sequential(*modules)(source)

class returnn.frontend.container.ParameterList(*parameters: Parameter | Iterable[Parameter] | Dict[str, Parameter] | ParameterList)[source]

Parameter list, getting passed an Iterable of Parameters and creates a list of Parameters in that order

By convention, any options to the module are passed to __init__, and potential changing inputs (other tensors) are passed to __call__().

append(parameter: Parameter) ParameterList[source]

appends one Parameter to the list

extend(parameters: Iterable[Parameter]) ParameterList[source]

appends multiple Parameters to the list