code: def _magc_resnet(
      arch: str,
      pretrained: bool,
      num_blocks: List[int],
      output_channels: List[int],
      stage_downsample: List[bool],
      stage_conv: List[bool],
      stage_pooling: List[Optional[Tuple[int, int]]],
      origin_stem: bool = True,
      **kwargs: Any,
  ) -> ResNet:
      kwargs["num_classes"] = kwargs.get(
          "num_classes", len(default_cfgs[arch]["classes"])
      )
      kwargs["input_shape"] = kwargs.get(
          "input_shape", default_cfgs[arch]["input_shape"]
      )
      kwargs["classes"] = kwargs.get(
          "classes", default_cfgs[arch]["classes"]
      )
  
      _cfg = deepcopy(default_cfgs[arch])
      _cfg["num_classes"] = kwargs["num_classes"]
      _cfg["classes"] = kwargs["classes"]
      _cfg["input_shape"] = kwargs["input_shape"]
      kwargs.pop("classes")
  
      # Build the model
      model = ResNet(
          num_blocks,
          output_channels,
          stage_downsample,
          stage_conv,
          stage_pooling,
          origin_stem,
          attn_module=partial(MAGC, headers=8, attn_scale=True),
          cfg=_cfg,
          **kwargs,
      )
      # Load pretrained parameters
      if pretrained:
          load_pretrained_params(model, default_cfgs[arch]["url"])
  
      return model
  
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 1 for calling a global function with example usage: _magc_resnet(arch, pretrained, num_blocks, output_channels, stage_downsample, stage_conv, stage_pooling, origin_stem) and returns: model