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,
      **kwargs,
  ):
      super().__init__(**kwargs)
      if in_channels != out_channels or stride > 1:
          self.downsampling_layer = [
              tf.keras.layers.LayerNormalization(
                  epsilon=1e-6,
                  name="downsampling_layer.0",
              ),
              # Inputs to this layer will follow NHWC format since we
              # transposed the inputs from NCHW to NHWC in the `TFConvNextEmbeddings`
              # layer. All the outputs throughout the model will be in NHWC
              # from this point on until the output where we again change to
              # NCHW.
              tf.keras.layers.Conv2D(
                  filters=out_channels,
                  kernel_size=kernel_size,
                  strides=stride,
                  kernel_initializer=get_initializer(
                      config.initializer_range
                  ),
                  bias_initializer="zeros",
                  name="downsampling_layer.1",
              ),
          ]
      else:
          self.downsampling_layer = [tf.identity]
  
      drop_path_rates = drop_path_rates or [0.0] * depth
      self.layers = [
          TFConvNextLayer(
              config,
              dim=out_channels,
              drop_path=drop_path_rates[j],
              name=f"layers.{j}",
          )
          for j in range(depth)
      ]
  
imports: from typing import Dict, Optional, Tuple, Union
  import numpy
  import tensorflow
  from transformers import shape_list
  from ...activations_tf import get_tf_activation
  from ...modeling_tf_outputs import TFBaseModelOutput, TFBaseModelOutputWithPooling, TFSequenceClassifierOutput
  from ...modeling_tf_utils import TFModelInputType, TFPreTrainedModel, TFSequenceClassificationLoss, get_initializer, keras_serializable, unpack_inputs
  from ...utils import add_start_docstrings, add_start_docstrings_to_model_forward, logging, replace_return_docstrings
  from .configuration_convnext import ConvNextConfig
label_desc: Use image node_id 1 to create a new TFConvNextStage object from inherited base classes: tf.keras.layers with example: obj = TFConvNextStage(config, in_channels, out_channels, kernel_size, stride, depth, drop_path_rates)