code: def __init__(self, depth, ctx, pretrained=True, num_classes=0):
      super(ResNet, self).__init__()
      self.pretrained = pretrained
  
      with self.name_scope():
          network = ResNet.__factory[depth](
              pretrained=pretrained, ctx=ctx
          ).features[0:-1]
          network[-1][0].body[0]._kwargs["stride"] = (1, 1)
          network[-1][0].downsample[0]._kwargs["stride"] = (1, 1)
          self.base = nn.HybridSequential()
          for n in network:
              self.base.add(n)
  
          self.avgpool = nn.GlobalAvgPool2D()
          self.flatten = nn.Flatten()
          self.bn = nn.BatchNorm(center=False, scale=True)
          self.bn.initialize(init=init.Zero(), ctx=ctx)
  
          self.classifier = nn.Dense(num_classes, use_bias=False)
          self.classifier.initialize(init=init.Normal(0.001), ctx=ctx)
  
file_path: gluon-cv/scripts/re-id/baseline/networks/resnet.py
imports: from __future__ import absolute_import
  from mxnet.gluon import nn, HybridBlock
  from mxnet import init
  from mxnet.gluon.model_zoo import vision
label_desc: Use image node_id 1 to create a new ResNet object from inherited base classes: HybridBlock with example: obj = ResNet(depth, ctx, pretrained, num_classes)