code: def _is_input_output_same_scale_zp(check_node):
      def fn(match):
          # Ensure all the inputs and output has same scale and zero point
          # Step 1: Check inputs/output zero point
          sub_nodes = filter_nodes(match.nodes, aten.sub.Tensor)
          zero_points = [node.args[1] for node in sub_nodes]
          add_nodes = filter_nodes(match.nodes, aten.add.Tensor)
          assert (
              len(add_nodes) == 1
          ), "expect only 1 add node at output quant pattern"
          zero_points.append(add_nodes[0].args[1])
          if not all(
              zero_point == zero_points[0] for zero_point in zero_points
          ):
              return False
  
          # Step 2: Check inputs/output scale
          mul_nodes = filter_nodes(match.nodes, aten.mul.Tensor)
          # We need to find mul node at output since the scale value is reciprocal to input scale.
          # Mul node at output should connect to cat node directly.
          scales = [
              (
                  mul_node.args[1]
                  if mul_node.args[0].target is check_node
                  else 1.0 / mul_node.args[1]
              )
              for mul_node in mul_nodes
          ]
          if not all(
              math.isclose(scale, scales[0], rel_tol=1e-5)
              for scale in scales
          ):
              return False
  
          return True
  
      return fn
  
imports: import copy
  import functools
  import itertools
  import math
  import operator
  from typing import Any, Tuple
  import torch
  from torch._dynamo.utils import counters
  from torch.fx.experimental.symbolic_shapes import has_free_symbols
  from ..lowering import lowerings, require_channels_last
  from ..pattern_matcher import Arg, CallFunction, filter_nodes, KeywordArg, ListOf, Match
  from ..utils import pad_listlike
  from .freezing_patterns import register_freezing_graph_pattern
  from .post_grad import register_lowering_pattern
label_desc: Use image node_id 19 for calling a global function with example usage: _is_input_output_same_scale_zp(check_node) and returns: fn, True, False, False