espnet2.asr.state_spaces.pool.DownAvgPool
espnet2.asr.state_spaces.pool.DownAvgPool
class espnet2.asr.state_spaces.pool.DownAvgPool(d_input, stride=1, expand=1, transposed=True)
Bases: SequenceModule
Initializes internal Module state, shared by both nn.Module and ScriptModule.
property d_output
Output dimension of model.
This attribute is required for all SequenceModule instantiations. It is used by the rest of the pipeline (e.g. model backbone, decoder) to track the internal shapes of the full model.
forward(x)
Forward pass.
A sequence-to-sequence transformation with an optional state.
Generally, this should map a tensor of shape (batch, length, self.d_model) to (batch, length, self.d_output)
Additionally, it returns a “state” which can be any additional information For example, RNN and SSM layers may return their hidden state, while some types of transformer layers (e.g. Transformer-XL) may want to pass a state as well
step(x, state, **kwargs)
Step the model recurrently for one step of the input sequence.
For example, this should correspond to unrolling an RNN for one step. If the forward pass has signature (B, L, H1) -> (B, L, H2), this method should generally have signature (B, H1) -> (B, H2) with an optional recurrent state.