code: def fuse_linear_bn(
      wrapper, fused_modules, params_dict, *args, **kwargs
  ):
      q_param_dict = {
          k: v.target
          for k, v in wrapper.quantization_target_spaces.items()
          if v.type is TargetType.PARAMETER
      }
      params_dict = params_dict.copy()
      bn_module = fused_modules[1]
      linear_module = wrapper.module
  
      if "weight" not in q_param_dict:
          raise ValueError(
              f"In the fusion process of linear_bn, the weight of {wrapper.name} needs to be quantized"
          )
  
      assert (
          bn_module.num_features == linear_module.out_features
      ), "the output features of Linear must match num_features of BatchNorm"
  
      with torch.no_grad():
          bias = get_bias(wrapper, params_dict)
          output = F.linear(
              *args, **kwargs, weight=q_param_dict["weight"], bias=bias
          )
          # statistic mean and var
          if not bn_module.track_running_stats:
              sta_output = output.detach().clone()
              sta_output = sta_output.contiguous().view(
                  -1, linear_module.out_features
              )
              mean = sta_output.mean(0).detach()
              var = sta_output.var(0).detach()
              bn_rm = mean
              bn_var = var
          else:
              _ = bn_module._nni_wrapper.module_forward(output)
              bn_rm = bn_module.running_mean
              bn_var = bn_module.running_var
  
      bn_eps = bn_module.eps
      # case: affine
      bn_w = (
          bn_module.weight
          if bn_module.affine
          else torch.ones_like(bn_rm)
      )
      bn_b = (
          bn_module.bias
          if bn_module.affine
          else torch.zeros_like(bn_rm)
      )
      # linear weight
      l_weight = q_param_dict["weight"]
      l_bias = get_bias(wrapper, params_dict)
      if l_bias is None:
          l_bias = torch.zeros_like(bn_rm)
      bn_scale = bn_w * torch.rsqrt(bn_var + bn_eps)
  
      fused_lin_w = l_weight * bn_scale.unsqueeze(-1)
      fused_lin_b = (l_bias - bn_rm) * bn_scale + bn_b
  
      params_dict["weight"] = fused_lin_w
      params_dict["bias"] = set_bias(wrapper, fused_lin_b)
  
      return params_dict, []
  
imports: from typing import Dict, Union, Tuple, Callable, Optional
  from collections.abc import Iterable
  from itertools import repeat
  import torch
  import torch.nn
  import torch.nn.functional
  from torch import Tensor
  from .target_space import TargetType
label_desc: Use image node_id 9 for calling a global function with example usage: fuse_linear_bn(wrapper, fused_modules, params_dict) and returns: params_dict,  list