class_docstr: RepMLP Net
  
  Args:
      - in_channels (`int`):
          Number of input channels.
      - num_classes (`int`):
          Number of classes.
      - patch_size (`tuple`):
          Patch size in a tuple (h, w).
      - num_blocks (`tuple`):
          Block numbers used in all stages
      - channels (`int`):
          Numbers of output channels used in all stages.
      - hs (`tuple`):
          Image heights used in all stages.
      - ws (`tuple`):
          Image weights used in all stages.
      - sharesets_nums (`tuple`):
          Shareset_nums used in all stages.
      - reparam_conv_k (`tuple`):
          Numbers of conv layers.
      - globalperceptron_reduce (`int`):
          Number to reduce internal hidden channels.
      - use_checkpoint (`bool`):
          Whether to load checkpoint.
      - deploy (`bool`):
          Flag to control deploy parameters like bias.
  
  Example:
      >>> from towhee.models.repmlp import RepMLPNet
      >>> import torch
      >>>
      >>> data = torch.rand(1, 3, 1536, 1536)
      >>> model = RepMLPNet()
      >>> outs = model(data)
      >>> print(data.shape)
      torch.Size([1, 1000])
class_docstr_tok: ["RepMLP","Net","Args",":","-","in_channels","(","`","int","`",")",":","Number","of","input","channels",".","-","num_classes","(","`","int","`",")",":","Number","of","classes",".","-","patch_size","(","`","tuple","`",")",":","Patch","size","in","a","tuple","(","h",",","w",")",".","-","num_blocks","(","`","tuple","`",")",":","Block","numbers","used","in","all","stages","-","channels","(","`","int","`",")",":","Numbers","of","output","channels","used","in","all","stages",".","-","hs","(","`","tuple","`",")",":","Image","heights","used","in","all","stages",".","-","ws","(","`","tuple","`",")",":","Image","weights","used","in","all","stages",".","-","sharesets_nums","(","`","tuple","`",")",":","Shareset_nums","used","in","all","stages",".","-","reparam_conv_k","(","`","tuple","`",")",":","Numbers","of","conv","layers",".","-","globalperceptron_reduce","(","`","int","`",")",":","Number","to","reduce","internal","hidden","channels",".","-","use_checkpoint","(","`","bool","`",")",":","Whether","to","load","checkpoint",".","-","deploy","(","`","bool","`",")",":","Flag","to","control","deploy","parameters","like","bias",".","Example",":",">",">",">","from","towhee.models.repmlp","import","RepMLPNet",">",">",">","import","torch",">",">",">",">",">",">","data","=","torch.rand","(","1",",","3",",","1536",",","1536",")",">",">",">","model","=","RepMLPNet","(",")",">",">",">","outs","=","model","(","data",")",">",">",">","print","(","data.shape",")","torch.Size","(","[","1",",","1000","]",")"]
code: def __init__(
      self,
      in_channels=3,
      num_class=1000,
      patch_size=(4, 4),
      num_blocks=(2, 2, 6, 2),
      channels=(192, 384, 768, 1536),
      hs=(64, 32, 16, 8),
      ws=(64, 32, 16, 8),
      sharesets_nums=(4, 8, 16, 32),
      reparam_conv_k=(3,),
      globalperceptron_reduce=4,
      use_checkpoint=False,
      deploy=False,
  ):
      super().__init__()
      num_stages = len(num_blocks)
      assert num_stages == len(channels)
      assert num_stages == len(hs)
      assert num_stages == len(ws)
      assert num_stages == len(sharesets_nums)
  
      self.conv_embedding = Conv2dBNActivation(
          in_planes=in_channels,
          out_planes=channels[0],
          kernel_size=patch_size,
          stride=patch_size,
          padding=0,
          activation_layer=nn.ReLU,
      )
  
      stages = []
      embeds = []
      for stage_idx in range(num_stages):
          stage_blocks = [
              RepMLPNetUnit(
                  channels=channels[stage_idx],
                  h=hs[stage_idx],
                  w=ws[stage_idx],
                  reparam_conv_k=reparam_conv_k,
                  globalperceptron_reduce=globalperceptron_reduce,
                  ffn_expand=4,
                  num_sharesets=sharesets_nums[stage_idx],
                  deploy=deploy,
              )
              for _ in range(num_blocks[stage_idx])
          ]
          stages.append(nn.ModuleList(stage_blocks))
          if stage_idx < num_stages - 1:
              embeds.append(
                  Conv2dBNActivation(
                      in_planes=channels[stage_idx],
                      out_planes=channels[stage_idx + 1],
                      kernel_size=2,
                      stride=2,
                      padding=0,
                      activation_layer=nn.ReLU,
                  )
              )
  
      self.stages = nn.ModuleList(stages)
      self.embeds = nn.ModuleList(embeds)
      self.head_norm = nn.BatchNorm2d(channels[-1])
      self.head = nn.Linear(channels[-1], num_class)
  
      self.use_checkpoint = use_checkpoint
  
file_path: towhee/towhee/models/repmlp/repmlp.py
imports: from torch import nn
  import torch.utils.checkpoint
  from towhee.models.layers.ffn import FFNBlock
  from towhee.models.layers.conv_bn_activation import Conv2dBNActivation
  from towhee.models.utils import create_model
  from .blocks import RepMLPBlock
  from .configs import get_configs
label_desc: Use image node_id 1 to create a new RepMLPNet object from inherited base classes: nn with example: obj = RepMLPNet(in_channels, num_class, patch_size, num_blocks, channels, hs, ws, sharesets_nums, reparam_conv_k, globalperceptron_reduce, use_checkpoint, deploy)