class_docstr: Class that handles conversion of pytorch models to the MIL format.
  
  Models passed to the @TorchConverter go from:
  Loaded-Torch Model -> Internal Graph -> PyMIL
code: def convert_const(self) -> None:
      for name, val in self.graph.params.items():
          if isinstance(val, torch._C.ScriptObject):
              logger.info(
                  f"Encountered constant {name} of type _torch._C.ScriptObject"
              )
              continue
          elif isinstance(val, torch.Tensor) and val.is_quantized:
              const = _dequantized_weight(val.cpu(), name)
              self.context.add(const)
              continue
          elif not isinstance(val, np.ndarray):
              raise ValueError(
                  f"unsupported class for {name} in PyTorch graph: {type(val)}"
              )
          # TODO (rdar://107718371): support uint8 quantization
          # Some torch models store indices with uint8, which are unrelated to quantization and
          # need to be cast to int32 since Core ML does not support int8.
          # We need a way to distinguish whether an uint8 is quantization (so should be kept)
          # or not (so should be cast to int32).
          if val.dtype == np.uint8:
              val = val.astype(np.int32)
          const = mb.const(val=val, name=name)
          self.context.add(const)
  
imports: from collections import OrderedDict
  from typing import List, Optional, Union
  import numpy
  import torch
  from torch.jit._script import RecursiveScriptModule
  from coremltools import _logger
  from coremltools._deps import _HAS_TORCH_EXPORT_API
  from coremltools.converters.mil._deployment_compatibility import AvailableTarget
  from coremltools.converters.mil.input_types import ImageType, InputType, TensorType
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import Function, Placeholder, Program, types
  from coremltools.converters.mil.mil.types import is_float
  from coremltools.converters.mil.mil.var import Var
  from .._utils import get_output_names
  from .internal_graph import InternalTorchIRGraph, InternalTorchIRNode
  from .ops import TorchFrontend, convert_nodes
  from .quantization_ops import _dequantized_weight
  from .torch_op_registry import _TORCH_OPS_REGISTRY
  from .torchir_passes import flatten_graph_input_values, flatten_graph_output_values, generate_tensor_assignment_ops, remove_getattr_nodes, transform_inplace_ops
  from .torchscript_utils import torch_to_mil_types
label_desc: Use image node_id 8 for calling the TorchConverter obj's underlying member method code with example usage: obj.convert_const() without return types