code: def _gen_fbnetv3(
      variant: str,
      channel_multiplier: float = 1.0,
      pretrained: bool = False,
      **kwargs,
  ):
      """FBNetV3
      Paper: `FBNetV3: Joint Architecture-Recipe Search using Predictor Pretraining`
          - https://arxiv.org/abs/2006.02049
      FIXME untested, this is a preliminary impl of some FBNet-V3 variants.
      """
      vl = variant.split("_")[-1]
      if vl in ("a", "b"):
          stem_size = 16
          arch_def = [
              ["ds_r2_k3_s1_e1_c16"],
              ["ir_r1_k5_s2_e4_c24", "ir_r3_k5_s1_e2_c24"],
              [
                  "ir_r1_k5_s2_e5_c40_se0.25",
                  "ir_r4_k5_s1_e3_c40_se0.25",
              ],
              ["ir_r1_k5_s2_e5_c72", "ir_r4_k3_s1_e3_c72"],
              [
                  "ir_r1_k3_s1_e5_c120_se0.25",
                  "ir_r5_k5_s1_e3_c120_se0.25",
              ],
              [
                  "ir_r1_k3_s2_e6_c184_se0.25",
                  "ir_r5_k5_s1_e4_c184_se0.25",
                  "ir_r1_k5_s1_e6_c224_se0.25",
              ],
              ["cn_r1_k1_s1_c1344"],
          ]
      elif vl == "d":
          stem_size = 24
          arch_def = [
              ["ds_r2_k3_s1_e1_c16"],
              ["ir_r1_k3_s2_e5_c24", "ir_r5_k3_s1_e2_c24"],
              [
                  "ir_r1_k5_s2_e4_c40_se0.25",
                  "ir_r4_k3_s1_e3_c40_se0.25",
              ],
              ["ir_r1_k3_s2_e5_c72", "ir_r4_k3_s1_e3_c72"],
              [
                  "ir_r1_k3_s1_e5_c128_se0.25",
                  "ir_r6_k5_s1_e3_c128_se0.25",
              ],
              [
                  "ir_r1_k3_s2_e6_c208_se0.25",
                  "ir_r5_k5_s1_e5_c208_se0.25",
                  "ir_r1_k5_s1_e6_c240_se0.25",
              ],
              ["cn_r1_k1_s1_c1440"],
          ]
      elif vl == "g":
          stem_size = 32
          arch_def = [
              ["ds_r3_k3_s1_e1_c24"],
              ["ir_r1_k5_s2_e4_c40", "ir_r4_k5_s1_e2_c40"],
              [
                  "ir_r1_k5_s2_e4_c56_se0.25",
                  "ir_r4_k5_s1_e3_c56_se0.25",
              ],
              ["ir_r1_k5_s2_e5_c104", "ir_r4_k3_s1_e3_c104"],
              [
                  "ir_r1_k3_s1_e5_c160_se0.25",
                  "ir_r8_k5_s1_e3_c160_se0.25",
              ],
              [
                  "ir_r1_k3_s2_e6_c264_se0.25",
                  "ir_r6_k5_s1_e5_c264_se0.25",
                  "ir_r2_k5_s1_e6_c288_se0.25",
              ],
              ["cn_r1_k1_s1_c1728"],
          ]
      else:
          raise NotImplemented
      round_chs_fn = partial(
          round_channels,
          multiplier=channel_multiplier,
          round_limit=0.95,
      )
      se_layer = partial(
          SqueezeExcite,
          gate_layer="hard_sigmoid",
          rd_round_fn=round_chs_fn,
      )
      act_layer = resolve_act_layer(kwargs, "hard_swish")
      model_kwargs = dict(
          block_args=decode_arch_def(arch_def),
          num_features=1984,
          head_bias=False,
          stem_size=stem_size,
          round_chs_fn=round_chs_fn,
          se_from_exp=False,
          norm_layer=partial(nn.BatchNorm2d, **resolve_bn_args(kwargs)),
          act_layer=act_layer,
          se_layer=se_layer,
          **kwargs,
      )
      model = _create_mnv3(variant, pretrained, **model_kwargs)
      return model
  
imports: from functools import partial
  from typing import Callable, List, Optional, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.utils.checkpoint import checkpoint
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD, IMAGENET_INCEPTION_MEAN, IMAGENET_INCEPTION_STD
  from timm.layers import SelectAdaptivePool2d, Linear, LayerType, PadType, create_conv2d, get_norm_act_layer
  from ._builder import build_model_with_cfg, pretrained_cfg_for_features
  from ._efficientnet_blocks import SqueezeExcite
  from ._efficientnet_builder import BlockArgs, EfficientNetBuilder, decode_arch_def, efficientnet_init_weights, round_channels, resolve_bn_args, resolve_act_layer, BN_EPS_TF_DEFAULT
  from ._features import FeatureInfo, FeatureHooks
  from ._manipulate import checkpoint_seq
  from ._registry import generate_default_cfgs, register_model, register_model_deprecations
label_desc: Use image node_id 4 for calling a global function with example usage: _gen_fbnetv3(variant, channel_multiplier, pretrained) and returns: model