automodule module

Full Documentation for hippynn.graphs.nodes.base.automodule module. Click here for a summary page.

class AutoModule(*args, module='auto', module_kwargs=None, **kwargs)[source]

Bases: SerializableNode

Helper mixin class for piping keyword arguments into an nn.module class.

Using AutoModule is required for text-based graph serialization.

Keyword Argument sources (lower precedence first):

  • module_kwargs argument to init.

  • kwarg-source pairs from self.auto_module_kwargs, where the value for the source is popped from the kwargs to the node.

  • self.module_kwargs.

Note: If self.auto_module_kwargs is not a dict, it will then be interpreted

as a list of keys for a dictionary with the identity for key-value mapping.

After constructing the kwargs, they are saved as self.module_kwargs.

classmethod from_record(name, parents, module_kwargs, db_name, state_dict, index_state=None)[source]
to_record()[source]
auto_module_kwargs: Tuple[str] | Dict[str, str] | None = None
serialization_attributes: tuple[str, ...] | None = ('module_kwargs',)