code: def generate_width_depth(wa, w0, wm, depth, q=8):
      """Generates per block widths from RegNet parameters."""
      assert wa > 0 and w0 > 0 and wm > 1 and w0 % q == 0
      widths_cont = np.arange(depth) * wa + w0
      width_exps = np.round(np.log(widths_cont / w0) / np.log(wm))
      widths_j = w0 * np.power(wm, width_exps)
      widths_j = np.round(np.divide(widths_j, q)) * q
      num_stages, max_stage = (
          len(np.unique(widths_j)),
          width_exps.max() + 1,
      )
      assert num_stages == int(max_stage)
      assert num_stages == 4
      widths = widths_j.astype(int).tolist()
      return widths, num_stages
  
imports: from typing import Optional
  import numpy
  import torch
  import torch.nn
  from torch import Tensor
label_desc: Use image node_id 3 for calling a global function with example usage: generate_width_depth(wa, w0, wm, depth, q) and returns: widths,  num_stages