code: def sar_resnet31(pretrained: bool = False, **kwargs: Any) -> SAR:
      """SAR with a resnet-31 feature extractor as described in `"Show, Attend and Read:A Simple and Strong
      Baseline for Irregular Text Recognition" <https://arxiv.org/pdf/1811.00751.pdf>`_.
  
      >>> import torch
      >>> from doctr.models import sar_resnet31
      >>> model = sar_resnet31(pretrained=False)
      >>> input_tensor = torch.rand((1, 3, 32, 128))
      >>> out = model(input_tensor)
  
      Args:
      ----
          pretrained (bool): If True, returns a model pre-trained on our text recognition dataset
          **kwargs: keyword arguments of the SAR architecture
  
      Returns:
      -------
          text recognition architecture
      """
      return _sar(
          "sar_resnet31",
          pretrained,
          resnet31,
          "10",
          ignore_keys=[
              "decoder.embed.weight",
              "decoder.embed_tgt.weight",
              "decoder.output_dense.weight",
              "decoder.output_dense.bias",
          ],
          **kwargs,
      )
  
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 2 for calling a global function with example usage: sar_resnet31(pretrained) and returns: _sar