code: def create_resnetv2_stem(
      in_chs,
      out_chs=64,
      stem_type="",
      preact=True,
      conv_layer=StdConv2d,
      norm_layer=partial(GroupNormAct, num_groups=32),
  ):
      stem = OrderedDict()
      assert stem_type in (
          "",
          "fixed",
          "same",
          "deep",
          "deep_fixed",
          "deep_same",
          "tiered",
      )
  
      # NOTE conv padding mode can be changed by overriding the conv_layer def
      if is_stem_deep(stem_type):
          # A 3 deep 3x3  conv stack as in ResNet V1D models
          if "tiered" in stem_type:
              stem_chs = (
                  3 * out_chs // 8,
                  out_chs // 2,
              )  # 'T' resnets in resnet.py
          else:
              stem_chs = (out_chs // 2, out_chs // 2)  # 'D' ResNets
          stem["conv1"] = conv_layer(
              in_chs, stem_chs[0], kernel_size=3, stride=2
          )
          stem["norm1"] = norm_layer(stem_chs[0])
          stem["conv2"] = conv_layer(
              stem_chs[0], stem_chs[1], kernel_size=3, stride=1
          )
          stem["norm2"] = norm_layer(stem_chs[1])
          stem["conv3"] = conv_layer(
              stem_chs[1], out_chs, kernel_size=3, stride=1
          )
          if not preact:
              stem["norm3"] = norm_layer(out_chs)
      else:
          # The usual 7x7 stem conv
          stem["conv"] = conv_layer(
              in_chs, out_chs, kernel_size=7, stride=2
          )
          if not preact:
              stem["norm"] = norm_layer(out_chs)
  
      if "fixed" in stem_type:
          # 'fixed' SAME padding approximation that is used in BiT models
          stem["pad"] = nn.ConstantPad2d(1, 0.0)
          stem["pool"] = nn.MaxPool2d(
              kernel_size=3, stride=2, padding=0
          )
      elif "same" in stem_type:
          # full, input size based 'SAME' padding, used in ViT Hybrid model
          stem["pool"] = create_pool2d(
              "max", kernel_size=3, stride=2, padding="same"
          )
      else:
          # the usual PyTorch symmetric padding
          stem["pool"] = nn.MaxPool2d(
              kernel_size=3, stride=2, padding=1
          )
  
      return nn.Sequential(stem)
  
imports: from collections import OrderedDict
  from functools import partial
  import torch
  import torch.nn
  from timm.data import IMAGENET_INCEPTION_MEAN, IMAGENET_INCEPTION_STD
  from timm.layers import GroupNormAct, BatchNormAct2d, EvoNorm2dS0, FilterResponseNormTlu2d, ClassifierHead, DropPath, AvgPool2dSame, create_pool2d, StdConv2d, create_conv2d, get_act_layer, get_norm_act_layer, make_divisible
  from ._builder import build_model_with_cfg
  from ._manipulate import checkpoint_seq, named_apply, adapt_input_conv
  from ._registry import generate_default_cfgs, register_model, register_model_deprecations
label_desc: Use image node_id 2 for calling a global function with example usage: create_resnetv2_stem(in_chs, out_chs, stem_type, preact, conv_layer, norm_layer) and returns: nn