class_docstr: This class implements the `X` block based on the ResNet bottleneck block. See figure 4 of RegNet
  paper `RegNet model <https://arxiv.org/pdf/2003.13678.pdf>`_
  
  Args:
      opts: command-line arguments
      width_in: The number of input channels
      width_out: The number of output channels
      stride: Stride for convolution
      groups: Number of groups for convolution
      bottleneck_multiplier: The number of in/out channels of the intermediate
          conv layer will be scaled by this value
      se_ratio: The numer squeeze-excitation ratio. The number of channels in the SE
          module will be scaled by this value
      stochastic_depth_prob: The stochastic depth probability
code: def __init__(
      self,
      opts: argparse.Namespace,
      width_in: int,
      width_out: int,
      stride: int,
      groups: int,
      bottleneck_multiplier: float,
      se_ratio: float,
      stochastic_depth_prob: float = 0.0,  # drop probability (= 1 - survival_prob)
  ) -> None:
      super().__init__()
  
      bottleneck_width = int(round(width_out * bottleneck_multiplier))
      bottleneck_groups = bottleneck_width // groups
  
      conv_1x1_1 = ConvLayer2d(
          opts=opts,
          in_channels=width_in,
          out_channels=bottleneck_width,
          kernel_size=1,
          stride=1,
          use_norm=True,
          use_act=True,
      )
  
      conv_3x3 = ConvLayer2d(
          opts=opts,
          in_channels=bottleneck_width,
          out_channels=bottleneck_width,
          kernel_size=3,
          stride=stride,
          groups=bottleneck_groups,
          use_norm=True,
          use_act=True,
      )
  
      se = Identity()
      if se_ratio > 0:
          squeeze_channels = int(round(se_ratio * width_in))
          se = SqueezeExcitation(
              opts,
              in_channels=bottleneck_width,
              squeeze_channels=squeeze_channels,
          )
  
      conv_1x1_2 = ConvLayer2d(
          opts=opts,
          in_channels=bottleneck_width,
          out_channels=width_out,
          kernel_size=1,
          stride=1,
          use_norm=True,
          use_act=True,
      )
  
      block = nn.Sequential()
      block.add_module("conv_1x1_1", module=conv_1x1_1)
      block.add_module("conv_3x3", module=conv_3x3)
      block.add_module("se", module=se)
      block.add_module("conv_1x1_2", module=conv_1x1_2)
  
      down_sample = Identity()
      if stride != 1 or width_out != width_in:
          down_sample = ConvLayer2d(
              opts,
              in_channels=width_in,
              out_channels=width_out,
              kernel_size=1,
              stride=stride,
              use_act=False,
          )
  
      act_type = getattr(opts, "model.activation.name")
      neg_slope = getattr(opts, "model.activation.neg_slope")
      inplace = getattr(opts, "model.activation.inplace")
      final_act = build_activation_layer(
          opts=opts,
          act_type=act_type,
          inplace=inplace,
          negative_slope=neg_slope,
          num_parameters=width_out,
      )
  
      self.stochastic_depth = StochasticDepth(
          p=stochastic_depth_prob, mode="row"
      )
  
      self.block = block
      self.down_sample = down_sample
      self.final_act = final_act
      self.width_in = width_in
      self.width_out = width_out
      self.stride = stride
      self.groups = groups
      self.bottleneck_multiplier = bottleneck_multiplier
      self.se_ratio = se_ratio
      self.stochastic_depth_prob = stochastic_depth_prob
  
file_path: ml-cvnets/cvnets/modules/regnet_modules.py
imports: import argparse
  from typing import List, Optional, Tuple
  from torch import Tensor, nn
  from cvnets.layers import ConvLayer2d, Identity, StochasticDepth
  from cvnets.layers.activation import build_activation_layer
  from cvnets.modules import BaseModule, SqueezeExcitation
label_desc: Use image node_id 1 to create a new XRegNetBlock object from inherited base classes: BaseModule with example: obj = XRegNetBlock(opts, width_in, width_out, stride, groups, bottleneck_multiplier, se_ratio, stochastic_depth_prob)