mllooper.ModuleList#

class mllooper.ModuleList(modules: List[Module], **kwargs)[source]#

Bases: Module

A module which represents a list of other modules.

initialise(modules: Dict[str, Module])[source]#

Perform initialization steps of all modules in the list.

Parameters:

modules (Dict[str, Module]) – Dictionary of other modules which are already initialised

load_state_dict(state_dict: Dict[str, any], strict: bool = True)[source]#

Load the modules state from a dictionary.

Parameters:
  • state_dict (Dict[str, any]) – The state dictionary to load

  • strict (bool) – If true rise an error on missing or additional keys in the state dict. If false these keys will be ignored.

log(state: State)[source]#

Log information from all modules in the list.

Parameters:

state (State) – The current state

state_dict() Dict[str, Any][source]#

Return the state of the module as dictionary.

All items of the dictionary should be serializable by pickle.

Returns:

The modules current state as dictionary

Return type:

Dict[str, Any]

step(state: State)[source]#

Perform a step of all modules in the list on the state.

Parameters:

state (State) – The current state

step_callback(state: State) None[source]#

Call callback of all modules in the list.

Parameters:

state (State) – The current state

teardown(state: State)[source]#

Teardown all modules in the list.

Parameters:

state (State) – The final state