code: def get_fc1(last_conv, num_classes, fc_type, input_channel=512):
      body = last_conv
      if fc_type == "Z":
          body = mx.sym.BatchNorm(
              data=body,
              fix_gamma=False,
              eps=2e-5,
              momentum=bn_mom,
              name="bn1",
          )
          body = mx.symbol.Dropout(data=body, p=0.4)
          fc1 = body
      elif fc_type == "E":
          body = mx.sym.BatchNorm(
              data=body,
              fix_gamma=False,
              eps=2e-5,
              momentum=bn_mom,
              name="bn1",
          )
          body = mx.symbol.Dropout(data=body, p=0.4)
          fc1 = mx.sym.FullyConnected(
              data=body, num_hidden=num_classes, name="pre_fc1"
          )
          fc1 = mx.sym.BatchNorm(
              data=fc1,
              fix_gamma=True,
              eps=2e-5,
              momentum=bn_mom,
              name="fc1",
          )
      elif fc_type == "FC":
          body = mx.sym.BatchNorm(
              data=body,
              fix_gamma=False,
              eps=2e-5,
              momentum=bn_mom,
              name="bn1",
          )
          fc1 = mx.sym.FullyConnected(
              data=body, num_hidden=num_classes, name="pre_fc1"
          )
          fc1 = mx.sym.BatchNorm(
              data=fc1,
              fix_gamma=True,
              eps=2e-5,
              momentum=bn_mom,
              name="fc1",
          )
      elif fc_type == "SFC":
          body = mx.sym.BatchNorm(
              data=body,
              fix_gamma=False,
              eps=2e-5,
              momentum=bn_mom,
              name="bn1",
          )
          body = Conv(
              data=body,
              num_filter=input_channel,
              kernel=(3, 3),
              stride=(2, 2),
              pad=(1, 1),
              no_bias=True,
              name="convf",
              num_group=input_channel,
          )
          body = mx.sym.BatchNorm(
              data=body,
              fix_gamma=False,
              eps=2e-5,
              momentum=bn_mom,
              name="bnf",
          )
          body = Act(data=body, act_type=config.net_act, name="reluf")
          body = Conv(
              data=body,
              num_filter=input_channel,
              kernel=(1, 1),
              pad=(0, 0),
              stride=(1, 1),
              name="convf2",
          )
          body = mx.sym.BatchNorm(
              data=body,
              fix_gamma=False,
              eps=2e-5,
              momentum=bn_mom,
              name="bnf2",
          )
          body = Act(data=body, act_type=config.net_act, name="reluf2")
          fc1 = mx.sym.FullyConnected(
              data=body, num_hidden=num_classes, name="pre_fc1"
          )
          fc1 = mx.sym.BatchNorm(
              data=fc1,
              fix_gamma=True,
              eps=2e-5,
              momentum=bn_mom,
              name="fc1",
          )
      elif fc_type == "GAP":
          bn1 = mx.sym.BatchNorm(
              data=body,
              fix_gamma=False,
              eps=2e-5,
              momentum=bn_mom,
              name="bn1",
          )
          relu1 = Act(data=bn1, act_type=config.net_act, name="relu1")
          # Although kernel is not used here when global_pool=True, we should put one
          pool1 = mx.sym.Pooling(
              data=relu1,
              global_pool=True,
              kernel=(7, 7),
              pool_type="avg",
              name="pool1",
          )
          flat = mx.sym.Flatten(data=pool1)
          fc1 = mx.sym.FullyConnected(
              data=flat, num_hidden=num_classes, name="pre_fc1"
          )
          fc1 = mx.sym.BatchNorm(
              data=fc1,
              fix_gamma=True,
              eps=2e-5,
              momentum=bn_mom,
              name="fc1",
          )
      elif fc_type == "GNAP":  # mobilefacenet++
          filters_in = 512  # param in mobilefacenet
          if num_classes > filters_in:
              body = mx.sym.Convolution(
                  data=last_conv,
                  num_filter=num_classes,
                  kernel=(1, 1),
                  stride=(1, 1),
                  pad=(0, 0),
                  no_bias=True,
                  name="convx",
              )
              body = mx.sym.BatchNorm(
                  data=body,
                  fix_gamma=False,
                  eps=2e-5,
                  momentum=0.9,
                  name="convx_bn",
              )
              body = Act(
                  data=body, act_type=config.net_act, name="convx_relu"
              )
              filters_in = num_classes
          else:
              body = last_conv
          body = mx.sym.BatchNorm(
              data=body,
              fix_gamma=True,
              eps=2e-5,
              momentum=0.9,
              name="bn6f",
          )
  
          spatial_norm = body * body
          spatial_norm = mx.sym.sum(
              data=spatial_norm, axis=1, keepdims=True
          )
          spatial_sqrt = mx.sym.sqrt(spatial_norm)
          # spatial_mean=mx.sym.mean(spatial_sqrt, axis=(1,2,3), keepdims=True)
          spatial_mean = mx.sym.mean(spatial_sqrt)
          spatial_div_inverse = mx.sym.broadcast_div(
              spatial_mean, spatial_sqrt
          )
  
          spatial_attention_inverse = mx.symbol.tile(
              spatial_div_inverse, reps=(1, filters_in, 1, 1)
          )
          body = body * spatial_attention_inverse
          # body = mx.sym.broadcast_mul(body, spatial_div_inverse)
  
          fc1 = mx.sym.Pooling(
              body, kernel=(7, 7), global_pool=True, pool_type="avg"
          )
          if num_classes < filters_in:
              fc1 = mx.sym.BatchNorm(
                  data=fc1,
                  fix_gamma=True,
                  eps=2e-5,
                  momentum=0.9,
                  name="bn6w",
              )
              fc1 = mx.sym.FullyConnected(
                  data=fc1, num_hidden=num_classes, name="pre_fc1"
              )
          else:
              fc1 = mx.sym.Flatten(data=fc1)
          fc1 = mx.sym.BatchNorm(
              data=fc1,
              fix_gamma=True,
              eps=2e-5,
              momentum=0.9,
              name="fc1",
          )
      elif fc_type == "GDC":  # mobilefacenet_v1
          conv_6_dw = Linear(
              last_conv,
              num_filter=input_channel,
              num_group=input_channel,
              kernel=(7, 7),
              pad=(0, 0),
              stride=(1, 1),
              name="conv_6dw7_7",
          )
          conv_6_f = mx.sym.FullyConnected(
              data=conv_6_dw, num_hidden=num_classes, name="pre_fc1"
          )
          fc1 = mx.sym.BatchNorm(
              data=conv_6_f,
              fix_gamma=True,
              eps=2e-5,
              momentum=bn_mom,
              name="fc1",
          )
      elif fc_type == "F":
          body = mx.sym.BatchNorm(
              data=body,
              fix_gamma=False,
              eps=2e-5,
              momentum=bn_mom,
              name="bn1",
          )
          body = mx.symbol.Dropout(data=body, p=0.4)
          fc1 = mx.sym.FullyConnected(
              data=body, num_hidden=num_classes, name="fc1"
          )
      elif fc_type == "G":
          body = mx.sym.BatchNorm(
              data=body,
              fix_gamma=False,
              eps=2e-5,
              momentum=bn_mom,
              name="bn1",
          )
          fc1 = mx.sym.FullyConnected(
              data=body, num_hidden=num_classes, name="fc1"
          )
      elif fc_type == "H":
          fc1 = mx.sym.FullyConnected(
              data=body, num_hidden=num_classes, name="fc1"
          )
      elif fc_type == "I":
          body = mx.sym.BatchNorm(
              data=body,
              fix_gamma=False,
              eps=2e-5,
              momentum=bn_mom,
              name="bn1",
          )
          fc1 = mx.sym.FullyConnected(
              data=body, num_hidden=num_classes, name="pre_fc1"
          )
          fc1 = mx.sym.BatchNorm(
              data=fc1,
              fix_gamma=True,
              eps=2e-5,
              momentum=bn_mom,
              name="fc1",
          )
      elif fc_type == "J":
          fc1 = mx.sym.FullyConnected(
              data=body, num_hidden=num_classes, name="pre_fc1"
          )
          fc1 = mx.sym.BatchNorm(
              data=fc1,
              fix_gamma=True,
              eps=2e-5,
              momentum=bn_mom,
              name="fc1",
          )
      return fc1
  
file_path: insightface/recognition/partial_fc/mxnet/symbol/symbol_utils.py
imports: import sys
  import os
  import mxnet
  from default import config
label_desc: Use image node_id 4 for calling a global function with example usage: get_fc1(last_conv, num_classes, fc_type, input_channel) and returns: fc1