class_docstr: Utilities to manage information pertaining to quantization of tensors in a PyTorch graph.
code: def __init__(self, context: "TranscriptionContext") -> None:
      self._context = context
  
      # Maps var name to tuple of (torch dtype, scale, zero_point)
      # zero_point is in a NumPy dtype corresponding to torch one (for e.g. np.uint8 for torch.quint8).
      self._quant_param_map = {}
      # In MIL Programs, if a MIL op doesn't support quantized I/O but the PyTorch ops do,
      # we just use floating-point tensors after dequantization. This means that information about
      # what dtype (int8/uint8) quantized tensors had in the PyTorch graph is not carried into
      # in the MIL graph.
      # To simplify, we only support a single dtype for activation quantizations throughout the
      # incoming graph.
      # The other option is to remember dtypes across ops, including MIL ones that don't support
      # quantized I/O. We will need to be careful about edge cases like conflicting dtypes, etc.
      self._quant_dtype = None
  
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 1 to create a new QuantizationContext object  with example: obj = QuantizationContext(context)