code: def forward(self, *args, **kwargs):
      args, kwargs = self.patch_inputs(*args, **kwargs)
  
      params_dict = {}
      params_dict.update(
          {
              k: v.target
              for k, v in self.pruning_target_spaces.items()
              if v.type is TargetType.PARAMETER
          }
      )
      params_dict.update(
          {
              k: v.target
              for k, v in self.distillation_target_spaces.items()
              if v.type is TargetType.PARAMETER
          }
      )
      params_dict.update(
          {
              k: v.target
              for k, v in self.quantization_target_spaces.items()
              if v.type is TargetType.PARAMETER
          }
      )
  
      activation_func_lis = []
      if len(self.fused_modules) > 0:
          params_dict, activation_func_lis = fuse_modules(
              self, params_dict, *args, **kwargs
          )
  
      # obtain original output
      original_outputs = None
      if (
          getattr(self, "is_bias_correction", False)
          and check_bias(self.module) == "Tensor"
      ):
          for target_name, original_param in params_dict.items():
              setattr(self.module, target_name, original_param * 1.0)
  
          original_outputs = self.module_forward(*args, **kwargs)
  
      params_dict = self.patch_params(params_dict)
      for target_name, patched_param in params_dict.items():
          # NOTE: here using copy_ will cause `backward through the graph a second time` error, don't know why.
          # We want to use copy_ for buffers because in-place modification can be recorded in DP, or it will be lost.
          # Here we use setattr to workaround because we don't need to record the buffer value for these module fake targets.
  
          # module_param: Tensor = getattr(self.module, target_name)
          # module_param.copy_(patched_param)
          setattr(self.module, target_name, patched_param)
  
      outputs = self.module_forward(*args, **kwargs)
      # fuse activation func
      for activation_module in activation_func_lis:
          outputs = activation_module._nni_wrapper.module_forward(
              outputs
          )
          if original_outputs is not None:
              original_outputs = (
                  activation_module._nni_wrapper.module_forward(
                      original_outputs
                  )
              )
  
      outputs = self.patch_outputs(outputs)
  
      if (
          getattr(self, "is_bias_correction", False)
          and check_bias(self.module) == "Tensor"
      ):
          assert isinstance(
              original_outputs, torch.Tensor
          ) and isinstance(
              outputs, torch.Tensor
          ), f"Bias correction is only applied to variables with tensor output types, but got {(type(original_outputs), type(outputs))}"
          element_num = functools.reduce(
              lambda x, y: x * y, list(original_outputs.shape[:-1])
          )
          dim_sum = tuple(range(len(original_outputs.shape[:-1])))
          bias_correction = torch.sum(
              original_outputs - outputs, dim=dim_sum
          )
          if not hasattr(self, "bias_correction"):
              setattr(self, "bias_correction", bias_correction)
          else:
              self.bias_correction += bias_correction
          if not hasattr(self, "bias_element_num"):
              setattr(self, "bias_element_num", element_num)
          else:
              self.bias_element_num: int = (
                  self.bias_element_num + element_num
              )
  
      torch.cuda.empty_cache()
  
      return outputs
  
imports: from __future__ import annotations
  from collections import defaultdict
  import logging
  import inspect
  import functools
  from typing import Any, Callable, Dict, List, Tuple, Type, Union, Literal
  import torch
  import torch.nn
  from torch import Tensor
  from .apply_method import pruning_apply_methods, quant_apply_methods
  from .config import select_modules_by_config
  from .setting import INPUT_PREFIX, OUTPUT_PREFIX, canonicalize_settings
  from .target_space import TargetSpace, TargetType, PruningTargetSpace, QuantizationTargetSpace, DistillationTargetSpace
  from .fuse_modules import fuse_modules
  from ..utils import check_bias, update_config, validate_fused_modules_config, get_fused_module_list, get_nested_attr
label_desc: Use image node_id 25 for calling the ModuleWrapper obj's underlying member method code with example usage: obj.forward() and returns: outputs