class_docstr: Implements a CRNN architecture as described in `"An End-to-End Trainable Neural Network for Image-based
  Sequence Recognition and Its Application to Scene Text Recognition" <https://arxiv.org/pdf/1507.05717.pdf>`_.
  
  Args:
  ----
      feature_extractor: the backbone serving as feature extractor
      vocab: vocabulary used for encoding
      rnn_units: number of units in the LSTM layers
      exportable: onnx exportable returns only logits
      beam_width: beam width for beam search decoding
      top_paths: number of top paths for beam search decoding
      cfg: configuration dictionary
class_docstr_tok: ["Implements","a","CRNN","architecture","as","described","in","`","``","An","End-to-End","Trainable","Neural","Network","for","Image-based","Sequence","Recognition","and","Its","Application","to","Scene","Text","Recognition","''","<","https",":","\/\/arxiv.org\/pdf\/1507.05717.pdf",">","`","_",".","Args",":","--","--","feature_extractor",":","the","backbone","serving","as","feature","extractor","vocab",":","vocabulary","used","for","encoding","rnn_units",":","number","of","units","in","the","LSTM","layers","exportable",":","onnx","exportable","returns","only","logits","beam_width",":","beam","width","for","beam","search","decoding","top_paths",":","number","of","top","paths","for","beam","search","decoding","cfg",":","configuration","dictionary"]
code: def call(
      self,
      x: tf.Tensor,
      target: Optional[List[str]] = None,
      return_model_output: bool = False,
      return_preds: bool = False,
      beam_width: int = 1,
      top_paths: int = 1,
      **kwargs: Any,
  ) -> Dict[str, Any]:
      if kwargs.get("training", False) and target is None:
          raise ValueError("Need to provide labels during training")
  
      features = self.feat_extractor(x, **kwargs)
      # B x H x W x C --> B x W x H x C
      transposed_feat = tf.transpose(features, perm=[0, 2, 1, 3])
      w, h, c = transposed_feat.get_shape().as_list()[1:]
      # B x W x H x C --> B x W x H * C
      features_seq = tf.reshape(transposed_feat, shape=(-1, w, h * c))
      logits = _bf16_to_float32(self.decoder(features_seq, **kwargs))
  
      out: Dict[str, tf.Tensor] = {}
      if self.exportable:
          out["logits"] = logits
          return out
  
      if return_model_output:
          out["out_map"] = logits
  
      if target is None or return_preds:
          # Post-process boxes
          out["preds"] = self.postprocessor(
              logits, beam_width=beam_width, top_paths=top_paths
          )
  
      if target is not None:
          out["loss"] = self.compute_loss(logits, target)
  
      return out
  
imports: from copy import deepcopy
  from typing import Any, Dict, List, Optional, Tuple, Union
  import tensorflow
  from tensorflow.keras import layers
  from tensorflow.keras.models import Model, Sequential
  from doctr.datasets import VOCABS
  from ...classification import mobilenet_v3_large_r, mobilenet_v3_small_r, vgg16_bn_r
  from ...utils.tensorflow import _bf16_to_float32, load_pretrained_params
  from ..core import RecognitionModel, RecognitionPostProcessor
label_desc: Use image node_id 3 for calling the CRNN obj's underlying member method code with example usage: obj.call(x, target, return_model_output, return_preds, beam_width, top_paths) and returns: out, out