parameters: (conv, bn)
return_statement: return conv
docstring: During inference, the functionary of batch norm layers is turned off but
      only the mean and var alone channels are used, which exposes the chance to
      fuse it with the preceding conv layers to save computations and simplify
      network structures.
docstring_summary: During inference, the functionary of batch norm layers is turned off but
      only the mean and var alone channels are used, which exposes the chance to
      fuse it with the preceding conv layers to save computations and simplify
      network structures.
docstring_tokens: During inference the functionary of batch norm layers is turned off but only the mean and var alone channels are used which exposes the chance to fuse it with the preceding conv layers to save computations and simplify network structures .
function: def fuse_conv_bn(conv, bn):
      """During inference, the functionary of batch norm layers is turned off but
      only the mean and var alone channels are used, which exposes the chance to
      fuse it with the preceding conv layers to save computations and simplify
      network structures."""
      conv_w = conv.weight
      conv_b = conv.bias if conv.bias is not None else torch.zeros_like(
          bn.running_mean)
  
      factor = bn.weight / torch.sqrt(bn.running_var + bn.eps)
      conv.weight = nn.Parameter(conv_w *
                                 factor.reshape([conv.out_channels, 1, 1, 1]))
      conv.bias = nn.Parameter((conv_b - bn.running_mean) * factor + bn.bias)
      return conv
function_tokens: def fuse_conv_bn ( conv , bn ) : conv_w = conv . weight conv_b = conv . bias if conv . bias is not None else torch . zeros_like ( bn . running_mean ) factor = bn . weight / torch . sqrt ( bn . running_var + bn . eps ) conv . weight = nn . Parameter ( conv_w * factor . reshape ( [ conv . out_channels , 1 , 1 , 1 ] ) ) conv . bias = nn . Parameter ( ( conv_b - bn . running_mean ) * factor + bn . bias ) return conv