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
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"]
code: def __init__(
      self,
      rnn_units: int,
      max_length: int,
      vocab_size: int,
      embedding_units: int,
      attention_units: int,
      feat_chans: int = 512,
      dropout_prob: float = 0.0,
  ) -> None:
      super().__init__()
      self.vocab_size = vocab_size
      self.max_length = max_length
  
      self.embed = nn.Linear(self.vocab_size + 1, embedding_units)
      self.embed_tgt = nn.Embedding(
          embedding_units, self.vocab_size + 1
      )
      self.attention_module = AttentionModule(
          feat_chans, rnn_units, attention_units
      )
      self.lstm_cell = nn.LSTMCell(rnn_units, rnn_units)
      self.output_dense = nn.Linear(2 * rnn_units, self.vocab_size + 1)
      self.dropout = nn.Dropout(dropout_prob)
  
imports: from copy import deepcopy
  from typing import Any, Callable, Dict, List, Optional, Tuple
  import torch
  from torch import nn
  from torch.nn import functional
  from torchvision.models._utils import IntermediateLayerGetter
  from doctr.datasets import VOCABS
  from ...classification import resnet31
  from ...utils.pytorch 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: nn with example: obj = SARDecoder(rnn_units, max_length, vocab_size, embedding_units, attention_units, feat_chans, dropout_prob)