class_docstr: This class implements a 'stage' as defined in the `RegNet paper <https://arxiv.org/pdf/2003.13678.pdf>`_.
  It consists of a sequence of bottleneck blocks.
  
  Args:
      opts: command-line arguments
      depth: The number of XRegNetBlocks in the stage
      width_in: The number of input channels of the first block
      width_out: The number of output channels of each block
      stride: Stride for convolution of first block
      groups: Number of groups for the intermediate convolution (bottleneck) layer in each block
      bottleneck_multiplier: The number of in/out channels of the intermediate
          conv layer of each block will be scaled by this value
      se_ratio: The numer squeeze-excitation ratio. The number of channels in the SE
          module of each block will be scaled by this value
      stage_depths: A list of the number of blocks in each stage
      stage_index: The index of the current stage being constructed
      stochastic_depth_prob: The stochastic depth probability
code: def __init__(
      self,
      opts: argparse.Namespace,
      depth: int,
      width_in: int,
      width_out: int,
      stride: int,
      groups: int,
      bottleneck_multiplier: float,
      se_ratio: float,
      stage_index: int,
      stochastic_depth_probs: List[float],
  ) -> None:
      super().__init__()
  
      stage_blocks = nn.Sequential()
  
      for i, sd_prob in enumerate(stochastic_depth_probs):
          block = XRegNetBlock(
              opts,
              width_in=width_in if i == 0 else width_out,
              width_out=width_out,
              stride=stride if i == 0 else 1,
              groups=groups,
              bottleneck_multiplier=bottleneck_multiplier,
              se_ratio=se_ratio,
              stochastic_depth_prob=sd_prob,
          )
          stage_blocks.add_module(
              f"Stage{stage_index}-Block{i}", module=block
          )
  
      self.stage = stage_blocks
      self.depth = depth
      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.stage_index = stage_index
      self.stochastic_depth_probs = stochastic_depth_probs
  
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 AnyRegNetStage object from inherited base classes: BaseModule with example: obj = AnyRegNetStage(opts, depth, width_in, width_out, stride, groups, bottleneck_multiplier, se_ratio, stage_index, stochastic_depth_probs)