class_docstr: Implements decoder module of the SAR model
  
  Args:
  ----
      rnn_units: number of hidden units in recurrent cells
      max_length: maximum length of a sequence
      vocab_size: number of classes in the model alphabet
      embedding_units: number of hidden embedding units
      attention_units: number of hidden attention units
      num_decoder_cells: number of LSTMCell layers to stack
      dropout_prob: dropout probability
class_docstr_tok: ["Implements","decoder","module","of","the","SAR","model","Args",":","--","--","rnn_units",":","number","of","hidden","units","in","recurrent","cells","max_length",":","maximum","length","of","a","sequence","vocab_size",":","number","of","classes","in","the","model","alphabet","embedding_units",":","number","of","hidden","embedding","units","attention_units",":","number","of","hidden","attention","units","num_decoder_cells",":","number","of","LSTMCell","layers","to","stack","dropout_prob",":","dropout","probability"]
code: def __init__(
      self,
      rnn_units: int,
      max_length: int,
      vocab_size: int,
      embedding_units: int,
      attention_units: int,
      num_decoder_cells: int = 2,
      dropout_prob: float = 0.0,
  ) -> None:
      super().__init__()
      self.vocab_size = vocab_size
      self.max_length = max_length
  
      self.embed = layers.Dense(embedding_units, use_bias=False)
      self.embed_tgt = layers.Embedding(
          embedding_units, self.vocab_size + 1
      )
  
      self.lstm_cells = layers.StackedRNNCells(
          [
              layers.LSTMCell(rnn_units, implementation=1)
              for _ in range(num_decoder_cells)
          ]
      )
      self.attention_module = AttentionModule(attention_units)
      self.output_dense = layers.Dense(
          self.vocab_size + 1, use_bias=True
      )
      self.dropout = layers.Dropout(dropout_prob)
  
imports: from copy import deepcopy
  from typing import Any, Dict, List, Optional, Tuple
  import tensorflow
  from tensorflow.keras import Model, Sequential, layers
  from doctr.datasets import VOCABS
  from doctr.utils.repr import NestedObject
  from ...classification import resnet31
  from ...utils.tensorflow import _bf16_to_float32, load_pretrained_params
  from ..core import RecognitionModel, RecognitionPostProcessor
label_desc: Use image node_id 1 to create a new SARDecoder object from inherited base classes: layers, NestedObject with example: obj = SARDecoder(rnn_units, max_length, vocab_size, embedding_units, attention_units, num_decoder_cells, dropout_prob)