class_docstr: LSTM-based decoder.
class_docstr_tok: ["LSTM-based","decoder","."]
docstr: Runs a single decoding time step.
  
  Modeled off of https://pytorch.org/tutorials/intermediate/seq2seq_translation_tutorial.html.
  
  Args:
      input: [batch_size] tensor with the previous step's predicted symbol.
      hidden_state: [batch_size, hidden_size] tensor with the previous step's hidden state.
      cell_state: [batch_size, hidden_size] tensor with the previous step's cell state.
  
  Returns:
      Tuple of 3 tensors:
      - output: [batch_size, vocab_size] tensor with the logits.
      - hidden_state: [batch_size, hidden_size] tensor with the hidden state for the next time step.
      - cell_state: [batch_size, hidden_size] tensor with the cell state for the next time step.
docstr_tok: ["Runs","a","single","decoding","time","step",".","Modeled","off","of","https",":","\/\/pytorch.org\/tutorials\/intermediate\/seq2seq_translation_tutorial.html",".","Args",":","input",":","[","batch_size","]","tensor","with","the","previous","step","'s","predicted","symbol",".","hidden_state",":","[","batch_size",",","hidden_size","]","tensor","with","the","previous","step","'s","hidden","state",".","cell_state",":","[","batch_size",",","hidden_size","]","tensor","with","the","previous","step","'s","cell","state",".","Returns",":","Tuple","of","3","tensors",":","-","output",":","[","batch_size",",","vocab_size","]","tensor","with","the","logits",".","-","hidden_state",":","[","batch_size",",","hidden_size","]","tensor","with","the","hidden","state","for","the","next","time","step",".","-","cell_state",":","[","batch_size",",","hidden_size","]","tensor","with","the","cell","state","for","the","next","time","step","."]
code: def forward(
      self,
      input: torch.Tensor,
      hidden_state: torch.Tensor,
      cell_state: torch.Tensor,
  ) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
      """Runs a single decoding time step.
  
      Modeled off of https://pytorch.org/tutorials/intermediate/seq2seq_translation_tutorial.html.
  
      Args:
          input: [batch_size] tensor with the previous step's predicted symbol.
          hidden_state: [batch_size, hidden_size] tensor with the previous step's hidden state.
          cell_state: [batch_size, hidden_size] tensor with the previous step's cell state.
  
      Returns:
          Tuple of 3 tensors:
          - output: [batch_size, vocab_size] tensor with the logits.
          - hidden_state: [batch_size, hidden_size] tensor with the hidden state for the next time step.
          - cell_state: [batch_size, hidden_size] tensor with the cell state for the next time step.
      """
      # Unsqueeze predicted tokens.
      input = input.unsqueeze(1).to(torch.int)
      output = self.embedding(input)
      output, (hidden_state, cell_state) = self.lstm(
          output, (hidden_state, cell_state)
      )
      output_logits = self.out(output)
      return output_logits, hidden_state, cell_state
  
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 2 for calling the LSTMDecoder obj's underlying member method code with example usage: obj.forward(input, hidden_state, cell_state) and returns: output_logits,  hidden_state,  cell_state