class_docstr: This class defines overparameterized large kernel conv block in `RepLKNet <https://arxiv.org/abs/2203.06717>`_
  Reference: https://github.com/DingXiaoH/RepLKNet-pytorch
  
  Args:
      opts: Command-line arguments.
      in_channels: Number of input channels.
      out_channels: Number of output channels.
      kernel_size: Kernel size of the large kernel conv branch.
      stride: Stride size. Default: 1
      dilation: Kernel dilation factor. Default: 1
      groups: Group number. Default: 1
      small_kernel_size: Kernel size of small kernel conv branch.
      inference_mode: If True, instantiates model in inference mode. Default: ``False``
      use_act: If True, activation is used. Default: ``True``
class_docstr_tok: ["This","class","defines","overparameterized","large","kernel","conv","block","in","`","RepLKNet","<","https",":","\/\/arxiv.org\/abs\/2203.06717",">","`","_","Reference",":","https",":","\/\/github.com\/DingXiaoH\/RepLKNet-pytorch","Args",":","opts",":","Command-line","arguments",".","in_channels",":","Number","of","input","channels",".","out_channels",":","Number","of","output","channels",".","kernel_size",":","Kernel","size","of","the","large","kernel","conv","branch",".","stride",":","Stride","size",".","Default",":","1","dilation",":","Kernel","dilation","factor",".","Default",":","1","groups",":","Group","number",".","Default",":","1","small_kernel_size",":","Kernel","size","of","small","kernel","conv","branch",".","inference_mode",":","If","True",",","instantiates","model","in","inference","mode",".","Default",":","``","False","``","use_act",":","If","True",",","activation","is","used",".","Default",":","``","True","``"]
code: def __init__(
      self,
      opts: argparse.Namespace,
      in_channels: int,
      out_channels: int,
      kernel_size: int,
      stride: int = 1,
      dilation: int = 1,
      groups: int = 1,
      small_kernel_size: int = None,
      inference_mode: bool = False,
      use_act: bool = True,
  ) -> None:
      super().__init__()
      self.stride = stride
      self.groups = groups
      self.dilation = dilation
      self.in_channels = in_channels
      self.out_channels = out_channels
  
      # Activation
      if use_act:
          self.activation = build_activation_layer(opts)
      else:
          self.activation = Identity()
  
      self.kernel_size = kernel_size
      self.small_kernel_size = small_kernel_size
      self.padding = kernel_size // 2
      if inference_mode:
          self.lkb_reparam = nn.Conv2d(
              in_channels=in_channels,
              out_channels=out_channels,
              kernel_size=kernel_size,
              stride=stride,
              padding=self.padding,
              dilation=self.dilation,
              groups=groups,
              bias=True,
          )
      else:
          self.lkb_origin = ConvLayer2d(
              opts,
              in_channels=self.in_channels,
              out_channels=self.out_channels,
              kernel_size=self.kernel_size,
              stride=self.stride,
              padding=self.padding,
              groups=self.groups,
              bias=False,
              use_act=False,
          )
          if small_kernel_size is not None:
              assert (
                  small_kernel_size <= kernel_size
              ), "The kernel size for re-param cannot be larger than the large kernel"
              self.small_conv = ConvLayer2d(
                  opts,
                  in_channels=self.in_channels,
                  out_channels=self.out_channels,
                  kernel_size=self.small_kernel_size,
                  stride=self.stride,
                  padding=self.small_kernel_size // 2,
                  groups=self.groups,
                  bias=False,
                  use_act=False,
              )
  
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 1 to create a new RepLKBlock object from inherited base classes: BaseModule with example: obj = RepLKBlock(opts, in_channels, out_channels, kernel_size, stride, dilation, groups, small_kernel_size, inference_mode, use_act)