code: def magc_resnet31(pretrained: bool = False, **kwargs: Any) -> ResNet:
      """Resnet31 architecture with Multi-Aspect Global Context Attention as described in
      `"MASTER: Multi-Aspect Non-local Network for Scene Text Recognition",
      <https://arxiv.org/pdf/1910.02562.pdf>`_.
  
      >>> import torch
      >>> from doctr.models import magc_resnet31
      >>> model = magc_resnet31(pretrained=False)
      >>> input_tensor = torch.rand((1, 3, 224, 224), dtype=tf.float32)
      >>> out = model(input_tensor)
  
      Args:
      ----
          pretrained: boolean, True if model is pretrained
          **kwargs: keyword arguments of the ResNet architecture
  
      Returns:
      -------
          A feature extractor model
      """
      return _magc_resnet(
          "magc_resnet31",
          pretrained,
          [1, 2, 5, 3],
          [256, 256, 512, 512],
          [1, 1, 1, 1],
          [True] * 4,
          [(2, 2), (2, 1), None, None],
          origin_stem=False,
          stem_channels=128,
          ignore_keys=["13.weight", "13.bias"],
          **kwargs,
      )
  
file_path: doctr/doctr/models/classification/magc_resnet/pytorch.py
imports: import math
  from copy import deepcopy
  from functools import partial
  from typing import Any, Dict, List, Optional, Tuple
  import torch
  from torch import nn
  from doctr.datasets import VOCABS
  from ...utils.pytorch import load_pretrained_params
  from ..resnet.pytorch import ResNet
label_desc: Use image node_id 2 for calling a global function with example usage: magc_resnet31(pretrained) and returns: _magc_resnet