code: def _conv_bn_fusion(conv_idx, bn_idx, layers):
      conv = layers[conv_idx].convolution
      bn = layers[bn_idx].batchnorm
  
      mean = _np.array(bn.mean.floatValue)
      variance = _np.array(bn.variance.floatValue) + bn.epsilon
      gamma = _np.array(bn.gamma.floatValue)
      beta = _np.array(bn.beta.floatValue)
      w = _np.array(conv.weights.floatValue)
  
      if conv.hasBias:
          b = _np.array(conv.bias.floatValue)
      else:
          b = _np.zeros(conv.outputChannels)
  
      w = w.reshape(
          conv.outputChannels, int(len(w) / conv.outputChannels)
      )
      wp = (gamma / _np.sqrt(variance))[:, None] * w
      bp = (
          (gamma * b / _np.sqrt(variance))
          - (gamma * mean / _np.sqrt(variance))
          + beta
      )
  
      del conv.weights.floatValue[:]
      if conv.hasBias:
          del conv.bias.floatValue[:]
  
      conv.weights.floatValue.extend(wp.flatten())
      conv.bias.floatValue.extend(bp)
      conv.hasBias = True
  
      print(
          "Fused {}->{}".format(
              layers[conv_idx].name, layers[bn_idx].name
          )
      )
      # re-wire outputs and delete batchnorm layer
      del layers[conv_idx].output[:]
      layers[conv_idx].output.extend(layers[bn_idx].output)
      del layers[bn_idx]
  
imports: import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: _conv_bn_fusion(conv_idx, bn_idx, layers) without return types