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 all linear ops in a branch.
  Reference: https://github.com/DingXiaoH/RepVGG/blob/main/repvgg.py#L95
  
  Args:
      branch: Sequence of ops to be fused.
  
  Returns:
      Tuple of (kernel, bias) after fusing batchnorm.
docstr_tok: ["Method","to","fuse","all","linear","ops","in","a","branch",".","Reference",":","https",":","\/\/github.com\/DingXiaoH\/RepVGG\/blob\/main\/repvgg.py","#","L95","Args",":","branch",":","Sequence","of","ops","to","be","fused",".","Returns",":","Tuple","of","(","kernel",",","bias",")","after","fusing","batchnorm","."]
code: def _fuse_branch_ops(
      self, branch: Union[nn.Sequential, nn.BatchNorm2d]
  ) -> Tuple[torch.Tensor, torch.Tensor]:
      """
      Method to fuse all linear ops in a branch.
      Reference: https://github.com/DingXiaoH/RepVGG/blob/main/repvgg.py#L95
  
      Args:
          branch: Sequence of ops to be fused.
  
      Returns:
          Tuple of (kernel, bias) after fusing batchnorm.
      """
      if isinstance(branch, nn.Sequential):
          kernel = branch.conv.weight
          return self._fuse_conv_bn(kernel, branch.norm)
      else:
          assert isinstance(branch, nn.BatchNorm2d)
          if not hasattr(self, "id_tensor"):
              input_dim = self.in_channels // self.groups
              kernel_value = torch.zeros(
                  (
                      self.in_channels,
                      input_dim,
                      self.kernel_size,
                      self.kernel_size,
                  ),
                  dtype=branch.weight.dtype,
                  device=branch.weight.device,
              )
              for i in range(self.in_channels):
                  kernel_value[
                      i,
                      i % input_dim,
                      self.kernel_size // 2,
                      self.kernel_size // 2,
                  ] = 1
              self.id_tensor = kernel_value
          kernel = self.id_tensor
          return self._fuse_conv_bn(kernel, branch)
  
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 5 for calling the MobileOneBlock obj's underlying member method code with example usage: obj._fuse_branch_ops(branch) and returns: self, self