class_docstr: AnyNet model.
class_docstr_tok: ["AnyNet","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, params=None):
      """Computes model complexity (if you alter the model, make sure to update)."""
      p = AnyNet.get_params() if not params else params
      stem_fun = get_stem_fun(p["stem_type"])
      block_fun = get_block_fun(p["block_type"])
      cx = stem_fun.complexity(cx, 3, p["stem_w"])
      prev_w = p["stem_w"]
      keys = ["depths", "widths", "strides", "bot_muls", "group_ws"]
      for d, w, s, b, g in zip(*[p[k] for k in keys]):
          params = {"bot_mul": b, "group_w": g, "se_r": p["se_r"]}
          cx = AnyStage.complexity(
              cx, prev_w, w, s, d, block_fun, params
          )
          prev_w = w
      cx = AnyHead.complexity(cx, prev_w, p["head_w"], p["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, SE
  from torch.nn import Module
label_desc: Use image node_id 4 for calling the AnyNet obj's underlying member method code with example usage: obj.complexity(cx, params) and returns: cx