class_docstr: Reparameterizable token mixer.
  
  For more details, please refer to our paper:
  `FastViT: A Fast Hybrid Vision Transformer using Structural Reparameterization <https://arxiv.org/pdf/2303.14189.pdf>`_
class_docstr_tok: ["Reparameterizable","token","mixer",".","For","more","details",",","please","refer","to","our","paper",":","`","FastViT",":","A","Fast","Hybrid","Vision","Transformer","using","Structural","Reparameterization","<","https",":","\/\/arxiv.org\/pdf\/2303.14189.pdf",">","`","_"]
docstr: Reparameterize mixer and norm into a single
  convolutional layer for efficient inference.
code: def reparameterize(self) -> None:
      """Reparameterize mixer and norm into a single
      convolutional layer for efficient inference.
      """
      if self.inference_mode:
          return
  
      self.mixer.reparameterize()
      self.norm.reparameterize()
  
      if self.use_layer_scale:
          w = self.mixer.id_tensor + self.layer_scale.unsqueeze(-1) * (
              self.mixer.reparam_conv.weight
              - self.norm.reparam_conv.weight
          )
          b = torch.squeeze(self.layer_scale) * (
              self.mixer.reparam_conv.bias - self.norm.reparam_conv.bias
          )
      else:
          w = (
              self.mixer.id_tensor
              + self.mixer.reparam_conv.weight
              - self.norm.reparam_conv.weight
          )
          b = self.mixer.reparam_conv.bias - self.norm.reparam_conv.bias
  
      self.reparam_conv = nn.Conv2d(
          in_channels=self.dim,
          out_channels=self.dim,
          kernel_size=self.kernel_size,
          stride=1,
          padding=self.kernel_size // 2,
          groups=self.dim,
          bias=True,
      )
      self.reparam_conv.weight.data = w
      self.reparam_conv.bias.data = b
  
      for para in self.parameters():
          para.detach_()
      self.__delattr__("mixer")
      self.__delattr__("norm")
      if self.use_layer_scale:
          self.__delattr__("layer_scale")
  
imports: import os
  import copy
  from functools import partial
  from typing import List, Tuple, Optional, Union
  import torch
  import torch.nn
  from timm.data import IMAGENET_DEFAULT_MEAN, IMAGENET_DEFAULT_STD
  from timm.models.layers import DropPath, trunc_normal_
  from timm.models.registry import register_model
  from models.modules.mobileone import MobileOneBlock
  from models.modules.replknet import ReparamLargeKernelConv
label_desc: Use image node_id 3 for calling the RepMixer obj's underlying member method code with example usage: obj.reparameterize() without return types