class_docstr: Utilities to manage information pertaining to quantization of tensors in a PyTorch graph.
docstr: Returns dequantized var & torch dtype corresponding to the named var.
docstr_tok: ["Returns","dequantized","var","&","torch","dtype","corresponding","to","the","named","var","."]
code: def get_dequantized_var(
      self, name: str, dequantized_name: str = None
  ):
      """
      Returns dequantized var & torch dtype corresponding to the named var.
      """
  
      original_var = self._context[name]
      if is_float(original_var.dtype):
          # Input doesn't need dequantization.
          # This might happen if in the PyTorch graph the upstream nodes supported quantized inputs,
          # but MIL does not. In that case, we already dequantized the vars before feeding them to
          # the MIL op.
          if dequantized_name is not None:
              self._context.add(original_var, dequantized_name)
          return original_var, self._quant_dtype
  
      quant_params = self.get_quantization_info(name)
      if quant_params is None:
          raise ValueError(
              f"Could not find quantization parameters for quantized var {original_var.name}"
          )
      torch_dtype, scale, zero_point, axis = quant_params
  
      # We add a new var corresponding to each dequantized value.
      # This ensures the atomicity of quantized op patterns in MIL.
      dequantized_var = mb.dequantize(
          input=original_var,
          scale=scale,
          zero_point=zero_point,
          axis=axis,
      )
      if dequantized_name is not None:
          dequantized_var_name = dequantized_name
      else:
          dequantized_var_name = dequantized_var.name
      self._context.add(dequantized_var, dequantized_var_name)
  
      return dequantized_var, torch_dtype
  
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 6 for calling the QuantizationContext obj's underlying member method code with example usage: obj.get_dequantized_var(name, dequantized_name) and returns: dequantized_var,  torch_dtype, original_var,  self