class_docstr: Implementation of reparameterizable conditional positional encoding.
  For more details refer to paper:
  `Conditional Positional Encodings for Vision Transformers <https://arxiv.org/pdf/2102.10882.pdf>`_
  
  Args:
      opts: Command line arguments.
      in_channels: Number of input channels.
      embed_dim: Number of embedding dimensions. Default: 768
      spatial_shape: Spatial shape of kernel for positional encoding. Default: (7, 7)
      inference_mode: Flag to instantiate block in inference mode. Default: ``False``
class_docstr_tok: ["Implementation","of","reparameterizable","conditional","positional","encoding",".","For","more","details","refer","to","paper",":","`","Conditional","Positional","Encodings","for","Vision","Transformers","<","https",":","\/\/arxiv.org\/pdf\/2102.10882.pdf",">","`","_","Args",":","opts",":","Command","line","arguments",".","in_channels",":","Number","of","input","channels",".","embed_dim",":","Number","of","embedding","dimensions",".","Default",":","768","spatial_shape",":","Spatial","shape","of","kernel","for","positional","encoding",".","Default",":","(","7",",","7",")","inference_mode",":","Flag","to","instantiate","block","in","inference","mode",".","Default",":","``","False","``"]
docstr: Forward pass implements inference logic for module
  before and after reparameterization.
  
  Args:
      x: Input tensor of shape :math:`(B, C, H, W)`.
  
  Returns:
      torch.Tensor of shape :math:`(B, C, H, W)`.
docstr_tok: ["Forward","pass","implements","inference","logic","for","module","before","and","after","reparameterization",".","Args",":","x",":","Input","tensor","of","shape",":","math",":","`","(","B",",","C",",","H",",","W",")","`",".","Returns",":","torch.Tensor","of","shape",":","math",":","`","(","B",",","C",",","H",",","W",")","`","."]
code: def forward(self, x: torch.Tensor, *args, **kwargs) -> torch.Tensor:
      """
      Forward pass implements inference logic for module
      before and after reparameterization.
  
      Args:
          x: Input tensor of shape :math:`(B, C, H, W)`.
  
      Returns:
          torch.Tensor of shape :math:`(B, C, H, W)`.
      """
      if hasattr(self, "reparam_conv"):
          x = self.reparam_conv(x)
          return x
      else:
          x = self.pe(x) + x
          return x
  
imports: import argparse
  from typing import Optional, Tuple, Union
  import torch
  import torch.nn
  from cvnets.layers import ConvLayer2d, MultiHeadAttention, StochasticDepth
  from cvnets.layers.normalization.batch_norm import BatchNorm2d
  from cvnets.modules import BaseModule
  from cvnets.modules.mobileone_block import MobileOneBlock, RepLKBlock
label_desc: Use image node_id 2 for calling the RepCPE obj's underlying member method code with example usage: obj.forward(x) and returns: x, x