code: def _extract_info_from_trace_node(trace_node):
      """
      Extract parameters from a trace node.
  
      Parameters
      ----------
      trace_node: torch._C.Value
      """
      input_shape = []
      output_shape = []
  
      inputs = list(trace_node.inputs())
  
      # cat input tensors are in a strange place
      if trace_node.kind() == "aten::cat":
          input_shape = [
              input.type().sizes()
              for input in inputs[0].node().inputs()
          ]
      else:
          for _input in inputs:
              input_type = _input.type()
              if input_type.kind() == "TensorType":
                  shape = input_type.sizes()
                  if shape:
                      input_shape.append(shape)
  
      for _output in trace_node.outputs():
          output_type = _output.type()
          if output_type.kind() == "TensorType":
              shape = output_type.sizes()
              if shape:
                  output_shape.append(shape)
  
      shape_parameters = {
          "input_shape": input_shape,
          "output_shape": output_shape,
      }
  
      if trace_node.kind() == "aten::cat":
          parameters = {"dim": inputs[1].toIValue()}
          return shape_parameters, parameters
      else:
          return shape_parameters, None
  
file_path: nni/nni/nas/space/pytorch/converter/utils.py
imports: from typing import Optional
  from typing_extensions import TypeGuard
  from nni.nas.space.graph import Cell, GraphModelSpace, Graph, Node, Edge
label_desc: Use image node_id 5 for calling a global function with example usage: _extract_info_from_trace_node(trace_node) and returns: shape_parameters,  parameters, shape_parameters,  None