code: def get_model_layers(model, dt, parent_name=None):
      layers = {}
      for name, m in model.named_children():
          layer_name = (
              "{}__{}".format(parent_name, name)
              if parent_name
              else name
          )
          layer_name += ".{}".format(type(m).__name__)
  
          if len(list(m.named_children())):
              layers.update(get_model_layers(m, dt, layer_name))
          else:
              layers[layer_name] = {}
              weight = None
              if hasattr(m, "weight") and m.weight is not None:
                  weight = getattr(m.weight, dt, None)
                  if weight is not None:
                      layers[layer_name]["weight"] = get_pt_tensor(
                          weight
                      ).numpy()
  
              bias = None
              if hasattr(m, "bias") and m.bias is not None:
                  bias = getattr(m.bias, dt, None)
                  if bias is not None:
                      layers[layer_name]["bias"] = get_pt_tensor(
                          bias
                      ).numpy()
  
      return layers
  
label_desc: Use image node_id 3 for calling a global function with example usage: get_model_layers(model, dt, parent_name) and returns: layers