code: def get_resnet_conv(data, sym):
      all_layers = sym.get_internals()
      isize = 640
      _, out_shape, _ = all_layers.infer_shape(
          data=(1, 3, isize, isize)
      )
      last_entry = None
      c1 = None
      c2 = None
      c3 = None
      # print(len(all_layers), len(out_shape))
      # print(all_layers.__class__)
      outputs = all_layers.list_outputs()
      # print(outputs.__class__, len(outputs))
      count = len(outputs)
      for i in range(count):
          name = outputs[i]
          shape = out_shape[i]
          if not name.endswith("_output"):
              continue
          if len(shape) != 4:
              continue
          print(name, shape)
          if c1 is None and shape[2] == isize // 16:
              cname = last_entry[0]
              print("c1", last_entry)
              c1 = all_layers[cname]
          if c2 is None and shape[2] == isize // 32:
              cname = last_entry[0]
              print("c2", last_entry)
              c2 = all_layers[cname]
          if shape[2] == isize // 32:
              c3 = all_layers[name]
              print("c3", name, shape)
  
          last_entry = (name, shape)
  
      c1_filter = -1
      c2_filter = -1
      c3_filter = -1
  
      F1 = 256
      F2 = 256
      _bwm = 1.0
      if config.NET_MODE == 0:
          c1_lateral = conv_act_layer(
              c1,
              "ssh_m1_red_conv",
              F2,
              kernel=(1, 1),
              pad=(0, 0),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c2_lateral = conv_act_layer(
              c2,
              "ssh_m2_red_conv",
              F2,
              kernel=(1, 1),
              pad=(0, 0),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          # conv5_128_up = mx.symbol.Deconvolution(data=conv5_128, num_filter=F2, kernel=(4,4),  stride=(2, 2), pad=(1,1),
          #    num_group = F2, no_bias = True, attr={'__lr_mult__': '0.0', '__wd_mult__': '0.0'},
          #    name='ssh_m2_red_upsampling')
          c2_up = mx.symbol.UpSampling(
              c2_lateral,
              scale=2,
              sample_type="nearest",
              workspace=512,
              name="ssh_m2_red_up",
              num_args=1,
          )
          # conv4_128 = mx.symbol.Crop(*[conv4_128, conv5_128_up])
          c2_up = mx.symbol.Crop(*[c2_up, c1_lateral])
  
          c1 = c1_lateral + c2_up
  
          c1 = conv_act_layer(
              c1,
              "ssh_m1_conv",
              F2,
              kernel=(3, 3),
              pad=(1, 1),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          m1 = ssh_detection_module(c1, F2, F2, "ssh_m1_det")
          m2 = ssh_detection_module(c2, F1, c2_filter, "ssh_m2_det")
          m3 = ssh_detection_module(c3, F1, c3_filter, "ssh_m3_det")
      elif config.NET_MODE == 1:
          c3_lateral = conv_act_layer(
              c3,
              "ssh_c3_lateral",
              F2,
              kernel=(1, 1),
              pad=(0, 0),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c3_up = mx.symbol.UpSampling(
              c3_lateral,
              scale=2,
              sample_type="nearest",
              workspace=512,
              name="ssh_c3_up",
              num_args=1,
          )
          c2_lateral = conv_act_layer(
              c2,
              "ssh_c2_lateral",
              F2,
              kernel=(1, 1),
              pad=(0, 0),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c3_up = mx.symbol.Crop(*[c3_up, c2_lateral])
          c2 = c2_lateral + c3_up
          c2 = conv_act_layer(
              c2,
              "ssh_c2_aggr",
              F2,
              kernel=(3, 3),
              pad=(1, 1),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c1_lateral = conv_act_layer(
              c1,
              "ssh_m1_red_conv",
              F2,
              kernel=(1, 1),
              pad=(0, 0),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c2_up = mx.symbol.UpSampling(
              c2,
              scale=2,
              sample_type="nearest",
              workspace=512,
              name="ssh_m2_red_up",
              num_args=1,
          )
          # conv4_128 = mx.symbol.Crop(*[conv4_128, conv5_128_up])
          c2_up = mx.symbol.Crop(*[c2_up, c1_lateral])
  
          c1 = c1_lateral + c2_up
  
          c1 = conv_act_layer(
              c1,
              "ssh_m1_conv",
              F2,
              kernel=(3, 3),
              pad=(1, 1),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          m1 = ssh_detection_module(c1, F2, F2, "ssh_m1_det")
          m2 = ssh_detection_module(c2, F1, c2_filter, "ssh_m2_det")
          m3 = ssh_detection_module(c3, F1, c3_filter, "ssh_m3_det")
      elif config.NET_MODE == 2:
          n1 = ssh_detection_module(c1, F2, F2, "ssh_n1_det")
          n2 = ssh_detection_module(c2, F1, c2_filter, "ssh_n2_det")
          n3 = ssh_detection_module(c3, F1, c3_filter, "ssh_n3_det")
          c3 = conv_act_layer(
              c3,
              "ssh_c3_lateral",
              F2,
              kernel=(1, 1),
              pad=(0, 0),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c3_up = mx.symbol.UpSampling(
              c3,
              scale=2,
              sample_type="nearest",
              workspace=512,
              name="ssh_c3_up",
              num_args=1,
          )
          c2_lateral = conv_act_layer(
              c2,
              "ssh_c2_lateral",
              F2,
              kernel=(1, 1),
              pad=(0, 0),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c3_up = mx.symbol.Crop(*[c3_up, c2_lateral])
          c2 = c2_lateral + c3_up
          c2 = conv_act_layer(
              c2,
              "ssh_c2_aggr",
              F2,
              kernel=(3, 3),
              pad=(1, 1),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c1_lateral = conv_act_layer(
              c1,
              "ssh_m1_red_conv",
              F2,
              kernel=(1, 1),
              pad=(0, 0),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c2_up = mx.symbol.UpSampling(
              c2,
              scale=2,
              sample_type="nearest",
              workspace=512,
              name="ssh_m2_red_up",
              num_args=1,
          )
          # conv4_128 = mx.symbol.Crop(*[conv4_128, conv5_128_up])
          c2_up = mx.symbol.Crop(*[c2_up, c1_lateral])
          c1 = c1_lateral + c2_up
          c1 = conv_act_layer(
              c1,
              "ssh_c1_aggr",
              F2,
              kernel=(3, 3),
              pad=(1, 1),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
  
          m1 = ssh_detection_module(c1, F2, F2, "ssh_m1_det")
          m2 = ssh_detection_module(c2, F1, c2_filter, "ssh_m2_det")
          m3 = ssh_detection_module(c3, F1, c3_filter, "ssh_m3_det")
      elif config.NET_MODE == 3:
          # c3 = conv_act_layer(c3, 'ssh_c3_lateral',
          #    F2, kernel=(1, 1), pad=(0, 0), stride=(1, 1), act_type='relu', bias_wd_mult=_bwm)
          c3 = ssh_detection_module(
              c3, F2 // 2, c3_filter, "ssh_c3_lateral"
          )
          c3_up = mx.symbol.UpSampling(
              c3,
              scale=2,
              sample_type="nearest",
              workspace=512,
              name="ssh_c3_up",
              num_args=1,
          )
          # c2_lateral = conv_act_layer(c2, 'ssh_c2_lateral',
          #    F2, kernel=(1, 1), pad=(0, 0), stride=(1, 1), act_type='relu', bias_wd_mult=_bwm)
          c2_lateral = ssh_detection_module(
              c2, F2 // 2, c2_filter, "ssh_c2_lateral"
          )
          c3_up = mx.symbol.Crop(*[c3_up, c2_lateral])
          c2 = c2_lateral + c3_up
          c2 = conv_act_layer(
              c2,
              "ssh_c2_aggr",
              F2,
              kernel=(3, 3),
              pad=(1, 1),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          # c1_lateral = conv_act_layer(c1, 'ssh_m1_red_conv',
          #    F2, kernel=(1, 1), pad=(0, 0), stride=(1, 1), act_type='relu', bias_wd_mult=_bwm)
          c1_lateral = ssh_detection_module(
              c1, F2 // 2, c1_filter, "ssh_c1_lateral"
          )
          c2_up = mx.symbol.UpSampling(
              c2,
              scale=2,
              sample_type="nearest",
              workspace=512,
              name="ssh_m2_red_up",
              num_args=1,
          )
          # conv4_128 = mx.symbol.Crop(*[conv4_128, conv5_128_up])
          c2_up = mx.symbol.Crop(*[c2_up, c1_lateral])
          c1 = c1_lateral + c2_up
          c1 = conv_act_layer(
              c1,
              "ssh_c1_aggr",
              F2,
              kernel=(3, 3),
              pad=(1, 1),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
  
          m1 = ssh_detection_module(c1, F2, F2, "ssh_m1_det")
          m2 = ssh_detection_module(c2, F1, c2_filter, "ssh_m2_det")
          m3 = ssh_detection_module(c3, F1, c3_filter, "ssh_m3_det")
      elif config.NET_MODE == 4:
          c3 = conv_act_layer(
              c3,
              "ssh_c3_lateral",
              F2,
              kernel=(1, 1),
              pad=(0, 0),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c3_up = mx.symbol.UpSampling(
              c3,
              scale=2,
              sample_type="nearest",
              workspace=512,
              name="ssh_c3_up",
              num_args=1,
          )
          c2_lateral = conv_act_layer(
              c2,
              "ssh_c2_lateral",
              F2,
              kernel=(1, 1),
              pad=(0, 0),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c3_up = mx.symbol.Crop(*[c3_up, c2_lateral])
          c2 = c2_lateral + c3_up
          c2 = conv_act_layer(
              c2,
              "ssh_c2_aggr",
              F2,
              kernel=(3, 3),
              pad=(1, 1),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c1_lateral = conv_act_layer(
              c1,
              "ssh_m1_red_conv",
              F2,
              kernel=(1, 1),
              pad=(0, 0),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c2_up = mx.symbol.UpSampling(
              c2,
              scale=2,
              sample_type="nearest",
              workspace=512,
              name="ssh_m2_red_up",
              num_args=1,
          )
          # conv4_128 = mx.symbol.Crop(*[conv4_128, conv5_128_up])
          c2_up = mx.symbol.Crop(*[c2_up, c1_lateral])
          c1 = c1_lateral + c2_up
          c1 = conv_act_layer(
              c1,
              "ssh_c1_aggr",
              F2,
              kernel=(3, 3),
              pad=(1, 1),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
  
          m1 = ssh_detection_module(c1, F2 // 2, F2, "ssh_m1_det")
          m2 = ssh_detection_module(
              c2, F1 // 2, c2_filter, "ssh_m2_det"
          )
          m3 = ssh_detection_module(
              c3, F1 // 2, c3_filter, "ssh_m3_det"
          )
      elif config.NET_MODE == 5:
          c3 = conv_act_layer_dw(
              c3,
              "ssh_c3_lateral_m",
              F2,
              kernel=(3, 3),
              pad=(1, 1),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c3 = conv_act_layer(
              c3,
              "ssh_c3_lateral",
              F2,
              kernel=(1, 1),
              pad=(0, 0),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c3_up = mx.symbol.UpSampling(
              c3,
              scale=2,
              sample_type="nearest",
              workspace=512,
              name="ssh_c3_up",
              num_args=1,
          )
          c2 = conv_act_layer_dw(
              c2,
              "ssh_c2_lateral_m",
              F2,
              kernel=(3, 3),
              pad=(1, 1),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c2_lateral = conv_act_layer(
              c2,
              "ssh_c2_lateral",
              F2,
              kernel=(1, 1),
              pad=(0, 0),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c3_up = mx.symbol.Crop(*[c3_up, c2_lateral])
          c2 = c2_lateral + c3_up
          c2 = conv_act_layer(
              c2,
              "ssh_c2_aggr",
              F2,
              kernel=(3, 3),
              pad=(1, 1),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c1 = conv_act_layer_dw(
              c1,
              "ssh_c1_lateral_m",
              F2,
              kernel=(3, 3),
              pad=(1, 1),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c1_lateral = conv_act_layer(
              c1,
              "ssh_m1_red_conv",
              F2,
              kernel=(1, 1),
              pad=(0, 0),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
          c2_up = mx.symbol.UpSampling(
              c2,
              scale=2,
              sample_type="nearest",
              workspace=512,
              name="ssh_m2_red_up",
              num_args=1,
          )
          # conv4_128 = mx.symbol.Crop(*[conv4_128, conv5_128_up])
          c2_up = mx.symbol.Crop(*[c2_up, c1_lateral])
          c1 = c1_lateral + c2_up
          c1 = conv_act_layer(
              c1,
              "ssh_c1_aggr",
              F2,
              kernel=(3, 3),
              pad=(1, 1),
              stride=(1, 1),
              act_type="relu",
              bias_wd_mult=_bwm,
          )
  
          m1 = ssh_detection_module(c1, F2, F2, "ssh_m1_det")
          m2 = ssh_detection_module(c2, F1, c2_filter, "ssh_m2_det")
          m3 = ssh_detection_module(c3, F1, c3_filter, "ssh_m3_det")
  
      return {8: m1, 16: m2, 32: m3}, {8: n1, 16: n2, 32: n3}
  
file_path: insightface/detection/retinaface/rcnn/symbol/symbol_resnet.py
imports: import mxnet
  import mxnet.ndarray
  import mxnet.gluon
  import mxnet.gluon.nn
  import mxnet.autograd
  import numpy
  from rcnn.config import config
  from rcnn.PY_OP import rpn_fpn_ohem3
  from rcnn.symbol.symbol_common import get_sym_train
label_desc: Use image node_id 7 for calling a global function with example usage: get_resnet_conv(data, sym) and returns: dict,  dict