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 tensorflow as tf
      >>> from doctr.models import magc_resnet31
      >>> model = magc_resnet31(pretrained=False)
      >>> input_tensor = tf.random.uniform(shape=[1, 224, 224, 3], maxval=1, 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],
          [False] * 4,
          [True] * 4,
          [(2, 2), (2, 1), None, None],
          False,
          stem_channels=128,
          **kwargs,
      )
  
file_path: doctr/doctr/models/classification/magc_resnet/tensorflow.py
imports: import math
  from copy import deepcopy
  from functools import partial
  from typing import Any, Dict, List, Optional, Tuple
  import tensorflow
  from tensorflow.keras import layers
  from tensorflow.keras.models import Sequential
  from doctr.datasets import VOCABS
  from ...utils import load_pretrained_params
  from ..resnet.tensorflow import ResNet
label_desc: Use image node_id 2 for calling a global function with example usage: magc_resnet31(pretrained) and returns: _magc_resnet