models.modules.LayerGen

models.modules.LayerGen#

class LayerGen[source]#

Bases: object

Base class for model layer generators

The get method must initialize the network module and pass it to the generator (See BlockGen).

Warning

This class can only be used as a base class for inheritance.

Methods

get

Initializes and returns the network layer

get(in_channels: int) Tuple[Module, int][source]#

Initializes and returns the network layer

Parameters:

in_channels (int) – Number of input channels.

Returns:

The generated module and the number of channels that will be after applying this layer to a tensor with in_channels channels.

Return type:

Tuple[nn.Module, int]