class_docstr: AnyNet stage (sequence of blocks w/ the same output shape).
class_docstr_tok: ["AnyNet","stage","(","sequence","of","blocks","w\/","the","same","output","shape",")","."]
code: def __init__(
      self,
      width_in: int,
      width_out: int,
      stride: int,
      depth: int,
      block_constructor: nn.Module,
      activation: nn.Module,
      group_width: int,
      bottleneck_multiplier: float,
      params: "AnyNetParams",
      stage_index: int = 0,
  ):
      super().__init__()
      self.stage_depth = 0
  
      for i in range(depth):
          block = block_constructor(
              width_in if i == 0 else width_out,
              width_out,
              stride if i == 0 else 1,
              params.bn_epsilon,
              params.bn_momentum,
              activation,
              group_width,
              bottleneck_multiplier,
              params.se_ratio,
          )
  
          self.stage_depth += block.depth
          self.add_module(f"block{stage_index}-{i}", block)
  
imports: import math
  from collections import OrderedDict
  from enum import auto, Enum
  from typing import Any, Dict, Optional, Sequence
  import torch.nn
  from classy_vision.generic.util import get_torch_version
  from classy_vision.models import ClassyModel, register_model
  from classy_vision.models.squeeze_and_excitation_layer import SqueezeAndExcitationLayer
label_desc: Use image node_id 1 to create a new AnyStage object from inherited base classes: nn with example: obj = AnyStage(width_in, width_out, stride, depth, block_constructor, activation, group_width, bottleneck_multiplier, params, stage_index)