class_docstr: For general quantized operators, in Core ML, we represent them as
  ``dequantize -> the floating-point version of this operator -> quantize``,
  because mathematically it is the floating-point tensor rather than
  its quantized integer representation that gets operated upon.
  
  For some quantized operators that do not involve floating-point arithmetic,
  however, it is unnecessary to prepend ``dequantize`` and append ``quantize``.
  Examples are:
  
  * reshape
class_docstr_tok: ["For","general","quantized","operators",",","in","Core","ML",",","we","represent","them","as","``","dequantize","-",">","the","floating-point","version","of","this","operator","-",">","quantize","``",",","because","mathematically","it","is","the","floating-point","tensor","rather","than","its","quantized","integer","representation","that","gets","operated","upon",".","For","some","quantized","operators","that","do","not","involve","floating-point","arithmetic",",","however",",","it","is","unnecessary","to","prepend","``","dequantize","``","and","append","``","quantize","``",".","Examples","are",":","*","reshape"]
code: def match_pattern(self, op: Operation) -> Tuple[Operation, Operation]:
      if (
          op.op_type not in self.INT_OP_TYPES_AND_OPSET_VERSIONS
          or op.opset_version
          not in self.INT_OP_TYPES_AND_OPSET_VERSIONS[op.op_type]
      ):
          return None
  
      # make sure the input is quantized
      dequantize = op.x.op
      if dequantize is None or dequantize.op_type != "dequantize":
          return None
  
      # make sure the output is quantized
      if not _check_child_op_type(op, "quantize"):
          return None
      quantize = op.outputs[0].child_ops[0]
  
      # we do not have to check block output, because:
      # * for dequantize, it is ok to connect to block output, since our
      #   transformation method `try_to_transform` is able to deal with that
      # * for op, checking child op has made sure it has only 1 child
      #   and connects to quantize, i.e. it cannot connect to block output
  
      return dequantize, quantize
  
imports: from typing import Tuple
  import numpy
  import coremltools.converters.mil.mil.types
  from coremltools.converters.mil._deployment_compatibility import AvailableTarget
  from coremltools.converters.mil.mil import Block
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil import Operation, Var
  from coremltools.converters.mil.mil.passes.graph_pass import AbstractGraphPass
  from coremltools.converters.mil.mil.passes.helper import _check_child_op_type, _check_no_output_connection, block_context_manager
  from coremltools.converters.mil.mil.passes.pass_registry import register_pass
label_desc: Use image node_id 3 for calling the int_op_canonicalization obj's underlying member method code with example usage: obj.match_pattern(op) and returns: dequantize,  quantize, None, None, None