class_docstr: RepMLP Block.
  
  Args:
      input_channels (`int`):
          Number of input channels & final output channels.
      internal_neurons (`int`):
          Number of channels used to connect conv2d layers inside block.
      h (`int`):
          Input image height.
      w (`int`):
          Input image weight.
      reparam_conv_k (`tuple or list`):
          Numbers of conv layers.
      globalperceptron_reduce (`int`):
          Number to reduce internal hidden channels.
      num_sharesets (`int`):
          Number of sharesets.
      deploy (`bool`):
          Flag to control deploy parameters like bias.
  
  Example:
      >>> from towhee.models.repmlp import RepMLPBlock
      >>> import torch
      >>>
      >>> data = torch.rand(1, 4, 6, 6)
      >>> model = RepMLPBlock(in_channels=4, out_channels=4, h=3, w=3)
      >>> outs = model(data)
      >>> print(outs.shape)
      torch.Size([1, 4, 6, 6])
class_docstr_tok: ["RepMLP","Block",".","Args",":","input_channels","(","`","int","`",")",":","Number","of","input","channels","&","final","output","channels",".","internal_neurons","(","`","int","`",")",":","Number","of","channels","used","to","connect","conv2d","layers","inside","block",".","h","(","`","int","`",")",":","Input","image","height",".","w","(","`","int","`",")",":","Input","image","weight",".","reparam_conv_k","(","`","tuple","or","list","`",")",":","Numbers","of","conv","layers",".","globalperceptron_reduce","(","`","int","`",")",":","Number","to","reduce","internal","hidden","channels",".","num_sharesets","(","`","int","`",")",":","Number","of","sharesets",".","deploy","(","`","bool","`",")",":","Flag","to","control","deploy","parameters","like","bias",".","Example",":",">",">",">","from","towhee.models.repmlp","import","RepMLPBlock",">",">",">","import","torch",">",">",">",">",">",">","data","=","torch.rand","(","1",",","4",",","6",",","6",")",">",">",">","model","=","RepMLPBlock","(","in_channels=4",",","out_channels=4",",","h=3",",","w=3",")",">",">",">","outs","=","model","(","data",")",">",">",">","print","(","outs.shape",")","torch.Size","(","[","1",",","4",",","6",",","6","]",")"]
code: def __init__(
      self,
      in_channels,
      out_channels,
      h,
      w,
      reparam_conv_k=None,
      globalperceptron_reduce=4,
      num_sharesets=1,
      deploy=False,
  ):
      super().__init__()
  
      self.in_c = in_channels
      self.out_c = out_channels
      self.share_s = num_sharesets
      self.h, self.w = h, w
      self.deploy = deploy
  
      assert in_channels == out_channels
      self.gp = GlobalPerceptron(
          input_channels=in_channels,
          internal_neurons=in_channels // globalperceptron_reduce,
      )
  
      self.fc3 = nn.Conv2d(
          self.h * self.w * num_sharesets,
          self.h * self.w * num_sharesets,
          1,
          1,
          0,
          bias=deploy,
          groups=num_sharesets,
      )
      if deploy:
          self.fc3_bn = nn.Identity()
      else:
          self.fc3_bn = nn.BatchNorm2d(num_sharesets)
  
      self.reparam_conv_k = reparam_conv_k
      if not deploy and reparam_conv_k is not None:
          for k in reparam_conv_k:
              conv_branch = Conv2dBNActivation(
                  num_sharesets,
                  num_sharesets,
                  kernel_size=k,
                  stride=1,
                  padding=k // 2,
                  groups=num_sharesets,
                  norm_layer=nn.BatchNorm2d,
                  eps=1e-5,
              )
              self.__setattr__(f"repconv{k}", conv_branch)
  
file_path: towhee/towhee/models/repmlp/blocks.py
imports: import torch
  from torch import nn
  from towhee.models.layers.conv_bn_activation import Conv2dBNActivation
  from towhee.models.utils.fuse_bn import fuse_bn
label_desc: Use image node_id 1 to create a new RepMLPBlock object from inherited base classes: nn with example: obj = RepMLPBlock(in_channels, out_channels, h, w, reparam_conv_k, globalperceptron_reduce, num_sharesets, deploy)