class_docstr: Simple LSTM Decoder for ASR models
  Args:
      feat_in (int): size of the input features
      num_classes (int): the size of the vocabulary
      lstm_hidden_size (int): hidden size of the LSTM layers
      vocabulary (vocab): The vocabulary
      bidirectional (bool): default is False. Whether LSTMs are bidirectional or not
      num_layers (int): default is 1. Number of LSTM layers stacked
class_docstr_tok: ["Simple","LSTM","Decoder","for","ASR","models","Args",":","feat_in","(","int",")",":","size","of","the","input","features","num_classes","(","int",")",":","the","size","of","the","vocabulary","lstm_hidden_size","(","int",")",":","hidden","size","of","the","LSTM","layers","vocabulary","(","vocab",")",":","The","vocabulary","bidirectional","(","bool",")",":","default","is","False",".","Whether","LSTMs","are","bidirectional","or","not","num_layers","(","int",")",":","default","is","1",".","Number","of","LSTM","layers","stacked"]
code: def __init__(
      self,
      feat_in,
      num_classes,
      lstm_hidden_size,
      vocabulary=None,
      bidirectional=False,
      num_layers=1,
  ):
      super().__init__()
  
      if vocabulary is not None:
          if num_classes != len(vocabulary):
              raise ValueError(
                  f"If vocabulary is specified, it's length should be equal to the num_classes. "
                  f"Instead got: num_classes={num_classes} and len(vocabulary)={len(vocabulary)}"
              )
          self.__vocabulary = vocabulary
      self._feat_in = feat_in
      # Add 1 for blank char
      self._num_classes = num_classes + 1
  
      self.lstm_layer = nn.LSTM(
          input_size=feat_in,
          hidden_size=lstm_hidden_size,
          num_layers=num_layers,
          batch_first=True,
          bidirectional=bidirectional,
      )
      lstm_hidden_size = (
          2 * lstm_hidden_size if bidirectional else lstm_hidden_size
      )
      self.linear_layer = torch.nn.Linear(
          in_features=lstm_hidden_size, out_features=self._num_classes
      )
  
file_path: NeMo/nemo/collections/asr/modules/lstm_decoder.py
imports: from collections import OrderedDict
  import torch
  import torch.nn
  from nemo.core.classes.common import typecheck
  from nemo.core.classes.exportable import Exportable
  from nemo.core.classes.module import NeuralModule
  from nemo.core.neural_types import AcousticEncodedRepresentation, LogprobsType, NeuralType
label_desc: Use image node_id 3 to create a new LSTMDecoder object from inherited base classes: NeuralModule, Exportable with example: obj = LSTMDecoder(feat_in, num_classes, lstm_hidden_size, vocabulary, bidirectional, num_layers)