class_docstr: Class that handles conversion of pytorch models represented in TorchScript
  format to the MIL format.
  
  Models passed to the @TorchConverter go from:
  TorchScript -> Expanded/Optimized Torch IR -> Internal Graph -> CoreML SSA
  The internal graph representation was added to make testing easier.
  
  Arguments:
      torchscript: torch.jit.ScriptModule object representing the model to convert.
      inputs: Input values and optional names. See kwarg in load.py for full description.
      outputs: Names of the graph's outputs. See kwarg in load.py for full description.
      cut_at_symbols: A list of internal symbol name strings. Graph conversion will
          terminate once these symbols have been generated. For debugging use
          only. See kwarg in load.py.
class_docstr_tok: ["Class","that","handles","conversion","of","pytorch","models","represented","in","TorchScript","format","to","the","MIL","format",".","Models","passed","to","the","@","TorchConverter","go","from",":","TorchScript","-",">","Expanded\/Optimized","Torch","IR","-",">","Internal","Graph","-",">","CoreML","SSA","The","internal","graph","representation","was","added","to","make","testing","easier",".","Arguments",":","torchscript",":","torch.jit.ScriptModule","object","representing","the","model","to","convert",".","inputs",":","Input","values","and","optional","names",".","See","kwarg","in","load.py","for","full","description",".","outputs",":","Names","of","the","graph","'s","outputs",".","See","kwarg","in","load.py","for","full","description",".","cut_at_symbols",":","A","list","of","internal","symbol","name","strings",".","Graph","conversion","will","terminate","once","these","symbols","have","been","generated",".","For","debugging","use","only",".","See","kwarg","in","load.py","."]
code: def convert(self):
      _logging.info("Converting graph.")
  
      # This will hold the converted model.
      prog = Program()
  
      # Construct placeholder for input to ssa function
      # This is where input renaming occurs
      ssa_func_inputs = OrderedDict()
      for index, (name, spec) in enumerate(self.graph.inputs.items()):
          placeholder = self._create_placeholder(spec)
          # Set ssa function input name to user defined name if provided.
          if spec.name is not None:
              name = spec.name
          self.inputs[index].name = name
          ssa_func_inputs[name] = placeholder
      prog.set_main_input_types(tuple(self.inputs))
  
      # Initialize the SSA for conversion
      with Function(ssa_func_inputs) as ssa_func:
          # Map internal @self.graph.inputs to user specified @ssa_func_inputs
          # If @self.graph.inputs == @ssa_func_inputs this just adds the inputs
          # to the context.
          for internal_name, users_name in zip(
              self.graph.inputs.keys(), ssa_func_inputs.keys()
          ):
              self.context.add(
                  ssa_func.inputs[users_name], torch_name=internal_name
              )
          for name, val in self.graph.params.items():
              mode = decide_immediate_or_file(val)
              const = mb.const(val=val, mode=mode, name=name)
              self.context.add(const)
  
          # Add the rest of the operations
          convert_nodes(self.context, self.graph)
  
          graph_outputs = [
              self.context[name] for name in self.graph.outputs
          ]
          # Output renaming occurs
          if self.output_names:
              for index, var in enumerate(graph_outputs):
                  output_rename = self.output_names[index]
                  var.name = output_rename
  
          ssa_func.set_outputs(graph_outputs)
          prog.add_function("main", ssa_func)
  
      # TODO (sberardi): graph cleanup passes
      # rdar://60177439
      return prog
  
imports: from __future__ import print_function
  from six import string_types
  import logging
  import torch
  from coremltools.converters.mil.input_types import InputType, ImageType
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import Placeholder, Function, Program, get_new_symbol
  from coremltools.converters.mil.mil import Var
  from .internal_graph import *
  from .ops import *
  from .torch_op_registry import _TORCH_OPS_REGISTRY
  from .torchir_passes import *
label_desc: Use image node_id 5 for calling the TorchConverter obj's underlying member method code with example usage: obj.convert() and returns: prog