code: def get_param_groups_and_shapes(named_model_params):
      named_model_params = list(named_model_params)
      scalar_vector_named_params = (
          [(n, p) for (n, p) in named_model_params if p.ndim <= 1],
          (-1),
      )
      matrix_named_params = (
          [(n, p) for (n, p) in named_model_params if p.ndim > 1],
          (1, -1),
      )
      return [scalar_vector_named_params, matrix_named_params]
  
imports: import numpy
  import torch
  import torch.nn
  from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors
  from .None import logger
label_desc: Use image node_id 7 for calling a global function with example usage: get_param_groups_and_shapes(named_model_params) and returns: list