class_docstr: ResNet model.
class_docstr_tok: ["ResNet","model","."]
docstr: Computes model complexity. If you alter the model, make sure to update.
docstr_tok: ["Computes","model","complexity",".","If","you","alter","the","model",",","make","sure","to","update","."]
code: def complexity(cx):
      """Computes model complexity. If you alter the model, make sure to update."""
      if "cifar" in cfg.TRAIN.DATASET:
          d = int((cfg.MODEL.DEPTH - 2) / 6)
          cx = ResStemCifar.complexity(cx, 3, 16)
          cx = ResStage.complexity(cx, 16, 16, stride=1, d=d)
          cx = ResStage.complexity(cx, 16, 32, stride=2, d=d)
          cx = ResStage.complexity(cx, 32, 64, stride=2, d=d)
          cx = ResHead.complexity(cx, 64, cfg.MODEL.NUM_CLASSES)
      else:
          g, gw = cfg.RESNET.NUM_GROUPS, cfg.RESNET.WIDTH_PER_GROUP
          (d1, d2, d3, d4) = _IN_STAGE_DS[cfg.MODEL.DEPTH]
          w_b = gw * g
          cx = ResStemIN.complexity(cx, 3, 64)
          cx = ResStage.complexity(
              cx, 64, 256, 1, d=d1, w_b=w_b, groups=g
          )
          cx = ResStage.complexity(
              cx, 256, 512, 2, d=d2, w_b=w_b * 2, groups=g
          )
          cx = ResStage.complexity(
              cx, 512, 1024, 2, d=d3, w_b=w_b * 4, groups=g
          )
          cx = ResStage.complexity(
              cx, 1024, 2048, 2, d=d4, w_b=w_b * 8, groups=g
          )
          cx = ResHead.complexity(cx, 2048, cfg.MODEL.NUM_CLASSES)
      return cx
  
imports: from pycls.core.config import cfg
  from pycls.models.blocks import activation, conv2d, conv2d_cx, gap2d, gap2d_cx, init_weights, linear, linear_cx, norm2d, norm2d_cx, pool2d, pool2d_cx
  from torch.nn import Module
label_desc: Use image node_id 5 for calling the ResNet obj's underlying member method code with example usage: obj.complexity(cx) and returns: cx