class_docstr: Convert a pytorch model to nni ir along with input/output shape info.
  Based ir acquired through ``torch.jit.script``
  and shape info acquired through ``torch.jit.trace``.
  
  .. warning::
  
      Known issues:
  
      1. ``InputChoice`` and ``ValueChoice`` not supported yet.
      2. Currently random inputs are fed while tracing layerchoice.
         If forward path of candidates depends on input data, then wrong path will be traced.
         This will result in incomplete shape info.
code: def _trace_module(
      self, module, module_name, ir_model: GraphModelSpace, dummy_input
  ):
      # First, trace the whole graph
      tm_graph = self._trace(module, dummy_input)
  
      for node in tm_graph.nodes():
          shape_parameters, parameters = _extract_info_from_trace_node(
              node
          )
          # '__module.convpool/__module.convpool.1/__module.convpool.1.conv'
          ir_node = match_node(ir_model, node, module_name)
          if ir_node is not None:
              ir_node.operation.attributes.update(shape_parameters)
              if parameters:
                  ir_node.operation.parameters.update(parameters)
  
      self.propagate_shape(ir_model)
  
      # trace each layerchoice
      for name, submodule in module.named_modules():
          # TODO: support InputChoice and ValueChoice
          if isinstance(submodule, LayerChoice):
              full_name = get_full_name_by_scope_name(
                  ir_model, name.split("."), module_name
              )
              lc_node = ir_model.get_node_by_name(full_name)
              assert (
                  lc_node is not None
              ), f"Cannot find a node with name {full_name}"
  
              for cand_name in submodule.names:
                  cand = submodule[cand_name]
                  cand_name = build_cand_name(
                      str(cand_name), submodule.label
                  )
                  # TODO: Feed the exact input tensor if user provides input,
                  # in case the path changes according to input data.
                  lc_inputs = [
                      torch.randn(shape)
                      for shape in lc_node.operation.attributes[
                          "input_shape"
                      ]
                  ]
                  self._trace_module(
                      cand, str(cand_name), ir_model, lc_inputs
                  )
  
imports: import re
  import torch
  from nni.nas.space.graph import Graph, GraphModelSpace, Node, Cell, Operation
  from nni.nas.nn.pytorch import InputChoice, MutationAnchor, LayerChoice, MutableModule, Repeat
  from nni.nas.utils import get_init_parameters_or_fail, get_importable_name
  from .op_types import MODULE_EXCEPT_LIST, OpTypeName
  from .utils import _convert_name, build_full_name, _without_shape_info, _extract_info_from_trace_node, get_full_name_by_scope_name, is_layerchoice_node, match_node, build_cand_name, build_python_name
label_desc: Use image node_id 3 for calling the GraphConverterWithShape obj's underlying member method code with example usage: obj._trace_module(module, module_name, ir_model, dummy_input) without return types