aihwkit.nn.modules.rnn.layers module
Analog RNN layers
- class aihwkit.nn.modules.rnn.layers.AnalogBidirRNNLayer(cell, *cell_args)[source]
Bases:
Module
Bi-directional analog RNN layer.
- Parameters:
cell (Type) – RNNCell type (AnalogLSTMCell/AnalogGRUCell/AnalogVanillaRNNCell)
cell_args (Any) – arguments to RNNCell (e.g. input_size, hidden_size, rpu_configs)
- class aihwkit.nn.modules.rnn.layers.AnalogRNNLayer(cell, *cell_args)[source]
Bases:
Module
Analog RNN Layer.
- Parameters:
cell (Type) – RNNCell type (AnalogLSTMCell/AnalogGRUCell/AnalogVanillaRNNCell/ AnalogLSTMCellSingleRPU)
cell_args (Any) – arguments to RNNCell (e.g. input_size, hidden_size, rpu_configs)
- class aihwkit.nn.modules.rnn.layers.AnalogReverseRNNLayer(cell, *cell_args)[source]
Bases:
Module
Analog RNN layer for direction.
- Parameters:
cell (Type) – RNNCell type (AnalogLSTMCell/AnalogGRUCell/AnalogVanillaRNNCell)
cell_args (Any) – arguments to RNNCell (e.g. input_size, hidden_size, rpu_configs)
- forward(input_, state)[source]
Forward pass.
- Parameters:
input – input tensor
state (Tuple[Tensor, Tensor] | Tensor) – LSTM state tensor
input_ (Tensor) –
- Returns:
stacked reverse outputs and state
- Return type:
Tuple[Tensor, Tuple[Tensor, Tensor] | Tensor]