code: def _register_dequant_promotion():
      dequant_pattern_cases = itertools.product(
          [torch.float32, torch.bfloat16], [True, False]
      )
      for dtype, input_dim_exceeds_two in dequant_pattern_cases:
          # 4 dequantization patterns will be matched based on the dtype and input dimension size.
          # Case 1: int8-mixed-fp32, input dim size is 2
          # Case 2: int8-mixed-fp32, input dim size exceeds 2
          # Case 3: int8-mixed-bf16, input dim size is 2
          # Case 4: int8-mixed-bf16, input dim size exceeds 2
          #           quant
          #   + - - - - | - - - - +
          #   |      dequant      |
          #   |         |         |
          #   |    OPT(to_bf16)   |
          #   |         |         |
          #   |    OPT(reshape)   |
          #   |      /     \      |
          #   |    node1  node2   |
          #   + - - | - - - | - - +
          #  OPT(reshape) OPT(reshape)
          #   + - - | - - - | - - +
          #  OPT(to_fp32) OPT(to_fp32)
          #   + - - | - - - | - - +
          #       quant   quant
          _register_dequant_promotion_pass(
              _may_generate_pattern_with_reshape(
                  _may_generate_pattern_with_dtype_convert(
                      dequantize_per_tensor_activation_pattern,
                      KeywordArg("autocast_act_dtype"),
                      dtype == torch.bfloat16,
                  ),
                  KeywordArg("act_reshape_size"),
                  with_reshape=input_dim_exceeds_two,
              ),
              pass_number=0,
              dtype=dtype,
          )
  
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 38 for calling a global function with example usage: _register_dequant_promotion() without return types