code: def _fuse_awq_mlp(
      model, current_module_name, fuse_module_names, module, target_cls
  ):
      """
      Fuse the MLP layers into a target class using autoawq
  
      Args:
          model (`~PreTrainedModel`):
              The input pretrained model
          current_module_name (`str`):
              The current submodule name
          fuse_module_names (`List[str]`):
              The list of module names to fuse. For the MLP layers it has to be an array
              of length 3 that consists of the 3 MLP layers in the order (gate (dense layer post-attention) / up / down layers)
          module (`nn.Module`):
              The pytorch parent module that has layernorm modules to fuse
          target_cls (`~autoawq.QuantFusedMLP`):
              The `QuantFusedMLP` class as it only supports that class
              for now.
      """
      if len(fuse_module_names) == 0:
          return
  
      if hasattr(module, fuse_module_names[0]):
          gate_proj = getattr(module, fuse_module_names[0])
          up_proj = getattr(module, fuse_module_names[1])
          down_proj = getattr(module, fuse_module_names[2])
  
          previous_device = gate_proj.qweight.device
  
          # Deal also with the case model has `text_config` attribute
          hidden_act = (
              model.config.hidden_act
              if not hasattr(model.config, "text_config")
              else model.config.text_config.hidden_act
          )
          activation_fn = ACT2FN[hidden_act]
          new_module = target_cls(
              gate_proj, down_proj, up_proj, activation_fn
          )
  
          parent_name, child_name = current_module_name.rsplit(".", 1)
          parent = model.get_submodule(parent_name)
          setattr(parent, child_name, new_module.to(previous_device))
  
          del gate_proj, up_proj, down_proj
  
file_path: transformers/src/transformers/integrations/awq.py
imports: from ..activations import ACT2FN
  from ..modeling_utils import PreTrainedModel
  from ..utils import is_auto_awq_available, is_torch_available
  from ..utils.quantization_config import AwqBackendPackingMethod, AwqConfig, AWQLinearVersion
label_desc: Use image node_id 5 for calling a global function with example usage: _fuse_awq_mlp(model, current_module_name, fuse_module_names, module, target_cls) without return types