class_docstr: S4 decoder module.
  
  Args:
      vocab_size: output dim
      encoder_output_size: dimension of hidden vector
      input_layer: input layer type
      dropinp: input dropout
      dropout: dropout parameter applied on every residual and every layer
      prenorm: pre-norm vs. post-norm
      n_layers: number of layers
      transposed: transpose inputs so each layer receives (batch, dim, length)
      tie_dropout: tie dropout mask across sequence like nn.Dropout1d/nn.Dropout2d
      n_repeat: each layer is repeated n times per stage before applying pooling
      layer: layer config, must be specified
      residual: residual config
      norm: normalization config (e.g. layer vs batch)
      pool: config for pooling layer per stage
      track_norms: log norms of each layer output
      drop_path: drop rate for stochastic depth
class_docstr_tok: ["S4","decoder","module",".","Args",":","vocab_size",":","output","dim","encoder_output_size",":","dimension","of","hidden","vector","input_layer",":","input","layer","type","dropinp",":","input","dropout","dropout",":","dropout","parameter","applied","on","every","residual","and","every","layer","prenorm",":","pre-norm","vs.","post-norm","n_layers",":","number","of","layers","transposed",":","transpose","inputs","so","each","layer","receives","(","batch",",","dim",",","length",")","tie_dropout",":","tie","dropout","mask","across","sequence","like","nn.Dropout1d\/nn.Dropout2d","n_repeat",":","each","layer","is","repeated","n","times","per","stage","before","applying","pooling","layer",":","layer","config",",","must","be","specified","residual",":","residual","config","norm",":","normalization","config","(","e.g",".","layer","vs","batch",")","pool",":","config","for","pooling","layer","per","stage","track_norms",":","log","norms","of","each","layer","output","drop_path",":","drop","rate","for","stochastic","depth"]
code: def __init__(
      self,
      vocab_size: int,
      encoder_output_size: int,
      input_layer: str = "embed",
      dropinp: float = 0.0,
      dropout: float = 0.25,
      prenorm: bool = True,
      n_layers: int = 16,
      transposed: bool = False,
      tie_dropout: bool = False,
      n_repeat=1,
      layer=None,
      residual=None,
      norm=None,
      pool=None,
      track_norms=True,
      drop_path: float = 0.0,
  ):
      assert check_argument_types()
      super().__init__()
  
      self.d_model = encoder_output_size
      self.sos = vocab_size - 1
      self.eos = vocab_size - 1
      self.odim = vocab_size
      self.dropout = dropout
  
      if input_layer == "embed":
          self.embed = torch.nn.Embedding(vocab_size, self.d_model)
      else:
          raise NotImplementedError
      self.dropout_emb = torch.nn.Dropout(p=dropout)
  
      self.decoder = SequenceModel(
          self.d_model,
          n_layers=n_layers,
          transposed=transposed,
          dropout=dropout,
          tie_dropout=tie_dropout,
          prenorm=prenorm,
          n_repeat=n_repeat,
          layer=layer,
          residual=residual,
          norm=norm,
          pool=pool,
          track_norms=track_norms,
          dropinp=dropinp,
          drop_path=drop_path,
      )
  
      self.output = torch.nn.Linear(self.d_model, vocab_size)
  
file_path: espnet/espnet2/asr/decoder/s4_decoder.py
imports: from typing import Any, List, Tuple
  import torch
  from typeguard import check_argument_types
  from espnet2.asr.decoder.abs_decoder import AbsDecoder
  from espnet2.asr.state_spaces.model import SequenceModel
  from espnet.nets.pytorch_backend.nets_utils import make_pad_mask
  from espnet.nets.scorer_interface import BatchScorerInterface
label_desc: Use image node_id 1 to create a new S4Decoder object from inherited base classes: AbsDecoder, BatchScorerInterface with example: obj = S4Decoder(vocab_size, encoder_output_size, input_layer, dropinp, dropout, prenorm, n_layers, transposed, tie_dropout, n_repeat, layer, residual, norm, pool, track_norms, drop_path)