class_docstr: ConvNeXT stage, consisting of an optional downsampling layer + multiple residual blocks.
  
  Args:
      config ([`ConvNextConfig`]): Model configuration class.
      in_channels (`int`): Number of input channels.
      out_channels (`int`): Number of output channels.
      depth (`int`): Number of residual blocks.
      drop_path_rates(`List[float]`): Stochastic depth rates for each layer.
class_docstr_tok: ["ConvNeXT","stage",",","consisting","of","an","optional","downsampling","layer","+","multiple","residual","blocks",".","Args",":","config","(","[","`","ConvNextConfig","`","]",")",":","Model","configuration","class",".","in_channels","(","`","int","`",")",":","Number","of","input","channels",".","out_channels","(","`","int","`",")",":","Number","of","output","channels",".","depth","(","`","int","`",")",":","Number","of","residual","blocks",".","drop_path_rates","(","`","List","[","float","]","`",")",":","Stochastic","depth","rates","for","each","layer","."]
code: def __init__(
      self,
      config,
      in_channels,
      out_channels,
      kernel_size=2,
      stride=2,
      depth=2,
      drop_path_rates=None,
  ):
      super().__init__()
  
      if in_channels != out_channels or stride > 1:
          self.downsampling_layer = nn.Sequential(
              ConvNextLayerNorm(
                  in_channels, eps=1e-6, data_format="channels_first"
              ),
              nn.Conv2d(
                  in_channels,
                  out_channels,
                  kernel_size=kernel_size,
                  stride=stride,
              ),
          )
      else:
          self.downsampling_layer = nn.Identity()
      drop_path_rates = drop_path_rates or [0.0] * depth
      self.layers = nn.Sequential(
          *[
              ConvNextLayer(
                  config, dim=out_channels, drop_path=drop_path_rates[j]
              )
              for j in range(depth)
          ]
      )
  
imports: from typing import Optional, Tuple, Union
  import torch
  import torch.utils.checkpoint
  from torch import nn
  from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss
  from ...activations import ACT2FN
  from ...modeling_outputs import BaseModelOutputWithNoAttention, BaseModelOutputWithPoolingAndNoAttention, ImageClassifierOutputWithNoAttention
  from ...modeling_utils import PreTrainedModel
  from ...utils import add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward, logging
  from .configuration_convnext import ConvNextConfig
label_desc: Use image node_id 1 to create a new ConvNextStage object from inherited base classes: nn with example: obj = ConvNextStage(config, in_channels, out_channels, kernel_size, stride, depth, drop_path_rates)