class_docstr: Implements encoder module of the SAR model
  
  Args:
  ----
      rnn_units: number of hidden rnn units
      dropout_prob: dropout probability
class_docstr_tok: ["Implements","encoder","module","of","the","SAR","model","Args",":","--","--","rnn_units",":","number","of","hidden","rnn","units","dropout_prob",":","dropout","probability"]
code: def __init__(self, rnn_units: int, dropout_prob: float = 0.0) -> None:
      super().__init__()
      self.rnn = Sequential(
          [
              layers.LSTM(
                  units=rnn_units,
                  return_sequences=True,
                  recurrent_dropout=dropout_prob,
              ),
              layers.LSTM(
                  units=rnn_units,
                  return_sequences=False,
                  recurrent_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 SAREncoder object from inherited base classes: layers, NestedObject with example: obj = SAREncoder(rnn_units, dropout_prob)