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
      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","cfg",":","configuration","dictionary"]
docstr: Compute CTC loss for the model.
  
  Args:
  ----
      model_output: predicted logits of the model
      target: list of target strings
  
  Returns:
  -------
      The loss of the model on the batch
docstr_tok: ["Compute","CTC","loss","for","the","model",".","Args",":","--","--","model_output",":","predicted","logits","of","the","model","target",":","list","of","target","strings","Returns",":","--","--","--","-","The","loss","of","the","model","on","the","batch"]
code: def compute_loss(
      self,
      model_output: torch.Tensor,
      target: List[str],
  ) -> torch.Tensor:
      """Compute CTC loss for the model.
  
      Args:
      ----
          model_output: predicted logits of the model
          target: list of target strings
  
      Returns:
      -------
          The loss of the model on the batch
      """
      gt, seq_len = self.build_target(target)
      batch_len = model_output.shape[0]
      input_length = model_output.shape[1] * torch.ones(
          size=(batch_len,), dtype=torch.int32
      )
      # N x T x C -> T x N x C
      logits = model_output.permute(1, 0, 2)
      probs = F.log_softmax(logits, dim=-1)
      ctc_loss = F.ctc_loss(
          probs,
          torch.from_numpy(gt),
          input_length,
          torch.tensor(seq_len, dtype=torch.int),
          len(self.vocab),
          zero_infinity=True,
      )
  
      return ctc_loss
  
imports: from copy import deepcopy
  from itertools import groupby
  from typing import Any, Callable, Dict, List, Optional, Tuple
  import torch
  from torch import nn
  from torch.nn import functional
  from doctr.datasets import VOCABS, decode_sequence
  from ...classification import mobilenet_v3_large_r, mobilenet_v3_small_r, vgg16_bn_r
  from ...utils.pytorch import load_pretrained_params
  from ..core import RecognitionModel, RecognitionPostProcessor
label_desc: Use image node_id 2 for calling the CRNN obj's underlying member method code with example usage: obj.compute_loss(model_output, target) and returns: ctc_loss