class_docstr: Building Block of RepLKNet
  
  This class defines overparameterized large kernel conv block
  introduced in `RepLKNet <https://arxiv.org/abs/2203.06717>`_
  
  Reference: https://github.com/DingXiaoH/RepLKNet-pytorch
docstr: Construct a ReparamLargeKernelConv module.
  
  Args:
      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
      groups: Group number. Default: 1
      small_kernel: Kernel size of small kernel conv branch.
      inference_mode: If True, instantiates model in inference mode. Default: ``False``
      activation: Activation module. Default: ``nn.GELU``
docstr_tok: ["Construct","a","ReparamLargeKernelConv","module",".","Args",":","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","groups",":","Group","number",".","Default",":","1","small_kernel",":","Kernel","size","of","small","kernel","conv","branch",".","inference_mode",":","If","True",",","instantiates","model","in","inference","mode",".","Default",":","``","False","``","activation",":","Activation","module",".","Default",":","``","nn.GELU","``"]
code: def __init__(
      self,
      in_channels: int,
      out_channels: int,
      kernel_size: int,
      stride: int,
      groups: int,
      small_kernel: int,
      inference_mode: bool = False,
      activation: nn.Module = nn.GELU(),
  ) -> None:
      """Construct a ReparamLargeKernelConv module.
  
      Args:
          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
          groups: Group number. Default: 1
          small_kernel: Kernel size of small kernel conv branch.
          inference_mode: If True, instantiates model in inference mode. Default: ``False``
          activation: Activation module. Default: ``nn.GELU``
      """
      super(ReparamLargeKernelConv, self).__init__()
  
      self.stride = stride
      self.groups = groups
      self.in_channels = in_channels
      self.out_channels = out_channels
      self.activation = activation
  
      self.kernel_size = kernel_size
      self.small_kernel = small_kernel
      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=1,
              groups=groups,
              bias=True,
          )
      else:
          self.lkb_origin = self._conv_bn(
              kernel_size=kernel_size, padding=self.padding
          )
          if small_kernel is not None:
              assert (
                  small_kernel <= kernel_size
              ), "The kernel size for re-param cannot be larger than the large kernel!"
              self.small_conv = self._conv_bn(
                  kernel_size=small_kernel, padding=small_kernel // 2
              )
  
file_path: ml-fastvit/models/modules/replknet.py
imports: from typing import Tuple
  import torch
  import torch.nn
label_desc: Use image node_id 1 to create a new ReparamLargeKernelConv object from inherited base classes: nn with example: obj = ReparamLargeKernelConv(in_channels, out_channels, kernel_size, stride, groups, small_kernel, inference_mode, activation)