code: def _remove_previous_dequantize_in_custom_module(
      node: Node, prev_node: Node, graph: Graph
  ) -> None:
      """
      Given a custom module `node`, if the previous node is a dequantize, reroute the custom as follows:
  
      Before: quantize - dequantize - custom_module
      After: quantize - custom_module
                   \\ - dequantize
      """
      # expecting the input node for a custom module node to be a Node
      assert isinstance(
          prev_node, Node
      ), f"Expecting the argument for custom module node to be a Node, but got {prev_node}"
      if (
          prev_node.op == "call_method"
          and prev_node.target == "dequantize"
      ):
          node.replace_input_with(prev_node, prev_node.args[0])
          # Remove the dequantize node if it doesn't have other users
          if len(prev_node.users) == 0:
              graph.erase_node(prev_node)
  
imports: from typing import Any, Dict, List, Optional, Set, Tuple, Union, Type, Callable
  from torch.ao.quantization.quant_type import QuantType
  import torch
  import copy
  import warnings
  from torch.fx import GraphModule
  from torch.fx.graph import Graph, Node, Argument
  from ..utils import activation_is_statically_quantized, weight_is_quantized, get_qparam_dict, _parent_name, get_swapped_custom_module_class
  from ..qconfig import QConfigAny, qconfig_equals
  from ..qconfig_mapping import QConfigMapping
  from .qconfig_mapping_utils import _generate_node_name_to_qconfig, _compare_prepare_convert_qconfig_mappings, _update_qconfig_for_fusion, _is_qconfig_supported_by_dtype_configs, _update_qconfig_for_qat
  from torch.ao.quantization.backend_config.utils import get_root_module_to_quantized_reference_module, get_pattern_to_dtype_configs, get_fused_module_classes, get_qat_module_classes
  from torch.ao.quantization.backend_config import BackendConfig, get_native_backend_config
  from torch.ao.quantization.observer import _is_activation_post_process
  from .graph_module import _is_observed_module, _is_observed_standalone_module
  from ._equalize import update_obs_for_equalization, convert_eq_obs
  from torch.nn.utils.parametrize import type_before_parametrizations
  from .utils import _get_module, _is_custom_module_lstm, _is_custom_module_mha, assert_and_get_unique_device, get_custom_module_class_keys, create_getattr_from_value, collect_producer_nodes, graph_module_from_producer_nodes, node_arg_is_weight
  from torch.ao.quantization.utils import is_per_channel, to_underlying_dtype
  from torch.ao.quantization.quantize import _remove_qconfig
  from torch.ao.quantization.stubs import DeQuantStub
  from .custom_config import ConvertCustomConfig, PrepareCustomConfig
  from .lower_to_fbgemm import lower_to_fbgemm
  from ._decomposed import quantized_decomposed_lib
  import operator
label_desc: Use image node_id 13 for calling a global function with example usage: _remove_previous_dequantize_in_custom_module(node, prev_node, graph) without return types