class_docstr: Dispatcher for different sequence generator decoders.
class_docstr_tok: ["Dispatcher","for","different","sequence","generator","decoders","."]
docstr: Args:
      vocab_size: Vocab size.
      max_sequence_length: Maximum sequence length.
      cell_type: Type of RNN cell to use. 'rnn', 'gru', or 'lstm'.
      input_size: Size of incoming combiner output.
      reduce_input: Mode with which to reduce incoming combiner output, if needed.
      num_layers: Number of layers for the RNN deecoders.
docstr_tok: ["Args",":","vocab_size",":","Vocab","size",".","max_sequence_length",":","Maximum","sequence","length",".","cell_type",":","Type","of","RNN","cell","to","use",".","'rnn","'",",","'gru","'",",","or","'lstm","'",".","input_size",":","Size","of","incoming","combiner","output",".","reduce_input",":","Mode","with","which","to","reduce","incoming","combiner","output",",","if","needed",".","num_layers",":","Number","of","layers","for","the","RNN","deecoders","."]
code: def __init__(
      self,
      vocab_size: int,
      max_sequence_length: int,
      cell_type: str = "gru",
      input_size: int = 256,
      reduce_input: str = "sum",
      num_layers: int = 1,
      decoder_config=None,
      **kwargs,
  ):
      """
      Args:
          vocab_size: Vocab size.
          max_sequence_length: Maximum sequence length.
          cell_type: Type of RNN cell to use. 'rnn', 'gru', or 'lstm'.
          input_size: Size of incoming combiner output.
          reduce_input: Mode with which to reduce incoming combiner output, if needed.
          num_layers: Number of layers for the RNN deecoders.
      """
      super().__init__()
      self.config = decoder_config
  
      self.vocab_size = vocab_size
      self.input_size = input_size
      self.max_sequence_length = max_sequence_length
      if cell_type == "lstm":
          self.rnn_decoder = SequenceLSTMDecoder(
              hidden_size=input_size,
              vocab_size=vocab_size,
              max_sequence_length=max_sequence_length,
              reduce_input=reduce_input,
              num_layers=num_layers,
          )
      else:
          self.rnn_decoder = SequenceRNNDecoder(
              hidden_size=input_size,
              vocab_size=vocab_size,
              max_sequence_length=max_sequence_length,
              cell_type=cell_type,
              reduce_input=reduce_input,
              num_layers=num_layers,
          )
  
imports: import logging
  from typing import Dict, Tuple
  import torch
  import torch.nn
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import LOGITS, PREDICTIONS, PROBABILITIES, SEQUENCE, TEXT
  from ludwig.decoders.base import Decoder
  from ludwig.decoders.registry import register_decoder
  from ludwig.decoders.sequence_decoder_utils import get_lstm_init_state, get_rnn_init_state
  from ludwig.modules.reduction_modules import SequenceReducer
  from ludwig.schema.decoders.sequence_decoders import SequenceGeneratorDecoderConfig
  from ludwig.utils import strings_utils
label_desc: Use image node_id 1 to create a new SequenceGeneratorDecoder object from inherited base classes: Decoder with example: obj = SequenceGeneratorDecoder(vocab_size, max_sequence_length, cell_type, input_size, reduce_input, num_layers, decoder_config)