class_docstr: Implements a ViTSTR architecture as described in `"Vision Transformer for Fast and
  Efficient Scene Text Recognition" <https://arxiv.org/pdf/2105.08582.pdf>`_.
  
  Args:
  ----
      feature_extractor: the backbone serving as feature extractor
      vocab: vocabulary used for encoding
      embedding_units: number of embedding units
      max_length: maximum word length handled by the model
      dropout_prob: dropout probability for the encoder and decoder
      input_shape: input shape of the image
      exportable: onnx exportable returns only logits
      cfg: dictionary containing information about the model
class_docstr_tok: ["Implements","a","ViTSTR","architecture","as","described","in","`","``","Vision","Transformer","for","Fast","and","Efficient","Scene","Text","Recognition","''","<","https",":","\/\/arxiv.org\/pdf\/2105.08582.pdf",">","`","_",".","Args",":","--","--","feature_extractor",":","the","backbone","serving","as","feature","extractor","vocab",":","vocabulary","used","for","encoding","embedding_units",":","number","of","embedding","units","max_length",":","maximum","word","length","handled","by","the","model","dropout_prob",":","dropout","probability","for","the","encoder","and","decoder","input_shape",":","input","shape","of","the","image","exportable",":","onnx","exportable","returns","only","logits","cfg",":","dictionary","containing","information","about","the","model"]
code: def __init__(
      self,
      feature_extractor,
      vocab: str,
      embedding_units: int,
      max_length: int = 32,
      dropout_prob: float = 0.0,
      input_shape: Tuple[int, int, int] = (
          32,
          128,
          3,
      ),  # different from paper
      exportable: bool = False,
      cfg: Optional[Dict[str, Any]] = None,
  ) -> None:
      super().__init__()
      self.vocab = vocab
      self.exportable = exportable
      self.cfg = cfg
      self.max_length = max_length + 2  # +2 for SOS and EOS
  
      self.feat_extractor = feature_extractor
      self.head = layers.Dense(
          len(self.vocab) + 1, name="head"
      )  # +1 for EOS
  
      self.postprocessor = ViTSTRPostProcessor(vocab=self.vocab)
  
file_path: doctr/doctr/models/recognition/vitstr/tensorflow.py
imports: from copy import deepcopy
  from typing import Any, Dict, List, Optional, Tuple
  import tensorflow
  from tensorflow.keras import Model, layers
  from doctr.datasets import VOCABS
  from ...classification import vit_b, vit_s
  from ...utils.tensorflow import _bf16_to_float32, load_pretrained_params
  from .base import _ViTSTR, _ViTSTRPostProcessor
label_desc: Use image node_id 1 to create a new ViTSTR object from inherited base classes: _ViTSTR, Model with example: obj = ViTSTR(feature_extractor, vocab, embedding_units, max_length, dropout_prob, input_shape, exportable, cfg)