class_docstr: MobileOne building block.
  
  For more details, please refer to our paper:
  `An Improved One millisecond Mobile Backbone <https://arxiv.org/pdf/2206.04040.pdf>`
class_docstr_tok: ["MobileOne","building","block",".","For","more","details",",","please","refer","to","our","paper",":","`","An","Improved","One","millisecond","Mobile","Backbone","<","https",":","\/\/arxiv.org\/pdf\/2206.04040.pdf",">","`"]
docstr: Method to fuse batchnorm layer with conv layer.
  
  Args:
      kernel: Convolutional kernel weights.
      bn: Batchnorm 2d layer.
  
  Returns:
      Tuple of (kernel, bias) after fusing batchnorm.
docstr_tok: ["Method","to","fuse","batchnorm","layer","with","conv","layer",".","Args",":","kernel",":","Convolutional","kernel","weights",".","bn",":","Batchnorm","2d","layer",".","Returns",":","Tuple","of","(","kernel",",","bias",")","after","fusing","batchnorm","."]
code: def _fuse_conv_bn(
      kernel: torch.Tensor, bn: nn.BatchNorm2d
  ) -> Tuple[torch.Tensor, torch.Tensor]:
      """
      Method to fuse batchnorm layer with conv layer.
  
      Args:
          kernel: Convolutional kernel weights.
          bn: Batchnorm 2d layer.
  
      Returns:
          Tuple of (kernel, bias) after fusing batchnorm.
      """
      assert bn.affine, (
          "Expected BatchNorm layer to have affine parameters "
          "instead got BatchNorm layer without affine parameters."
      )
      running_mean = bn.running_mean
      running_var = bn.running_var
      gamma = bn.weight
      beta = bn.bias
      eps = bn.eps
      std = (running_var + eps).sqrt()
      t = (gamma / std).reshape(-1, 1, 1, 1)
      return kernel * t, beta - running_mean * gamma / std
  
imports: import argparse
  from typing import Tuple, Union
  import torch
  import torch.nn
  from cvnets.layers import ConvLayer2d, Identity
  from cvnets.layers.activation import build_activation_layer
  from cvnets.layers.normalization.batch_norm import BatchNorm2d
  from cvnets.modules import BaseModule, SqueezeExcitation
label_desc: Use image node_id 6 for calling the MobileOneBlock obj's underlying member method code with example usage: obj._fuse_conv_bn(kernel, bn) and returns: unknown,  unknown