code: def scale_weight_node(
      node: Node,
      modules: Dict[str, nn.Module],
      equalization_scale: torch.Tensor,
      next_equalization_scale: Optional[torch.Tensor],
  ) -> None:
      """Scale the weights for input-weight equalization by multiplying the
      weight by 1/equalization_scale and next_equalization_scale
  
      Args:
          node: Current node whose weights we want to scale
          equalization_scale: Current node's calculated equalization scale
          next_equalization_scale: Next node's calculated equalization scale if
             the following node needs to be equalized, 1 otherwise
      """
      if equalization_scale is None:
          return
  
      if fused_module_supports_equalization(modules[str(node.target)]):
          op_module = modules[str(node.target)][0]  # type: ignore[index]
      else:
          op_module = modules[str(node.target)]
      assert nn_module_supports_equalization(
          op_module
      ) or custom_module_supports_equalization(op_module)
  
      # Scale the weights for input-weight equalization
      # If the following layer needs to be equalized then we will multiply its scale
      weight = op_module.weight
      assert isinstance(weight, torch.Tensor)
  
      # Scale the weights by the reciprocal of the equalization scale
      # Reshape the equalization scale so that we can multiply it to the weight along axis=1
      equalization_scale_reshaped = reshape_scale(
          equalization_scale, 1, weight
      )
      scaled_weight = torch.mul(
          weight, torch.reciprocal(equalization_scale_reshaped)
      )
  
      if next_equalization_scale is None:
          op_module.weight = nn.Parameter(scaled_weight)
          return
  
      # Multiply the weights row wise by the next equalization scale
      # Reshape the equalization scale so that we can multiply it to the weight along axis=0
      next_equalization_scale_reshaped = reshape_scale(
          next_equalization_scale, 0, weight
      )
      scaled_weight = torch.mul(
          scaled_weight, next_equalization_scale_reshaped
      )
  
      op_module.weight = nn.Parameter(scaled_weight)
  
      # Multiply the bias element wise by the next equalization scale
      bias = op_module.bias
      if bias is None:
          return
      assert isinstance(bias, torch.Tensor)
  
      # Reshape the equalization scale so that we can multiply it element-wise to the bias
      next_equalization_scale_reshaped = reshape_scale(
          next_equalization_scale, 0, bias
      )
      scaled_bias = torch.mul(bias, next_equalization_scale_reshaped)
      op_module.bias = nn.Parameter(scaled_bias)
  
imports: import warnings
  from collections import namedtuple
  from typing import Any, Dict, List, Optional, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.ao.nn.intrinsic
  from torch.fx import GraphModule
  from torch.fx.graph import Node
  from torch.ao.quantization.fx.graph_module import _get_observed_graph_module_attr
  from ..observer import _with_args, ObserverBase, PerChannelMinMaxObserver
  from ..utils import _parent_name, check_min_max_valid
  from .utils import get_new_attr_name_with_prefix, maybe_get_next_module, node_arg_is_weight
label_desc: Use image node_id 13 for calling a global function with example usage: scale_weight_node(node, modules, equalization_scale, next_equalization_scale) without return types