code: def __init__(
      self,
      config: ConvNextConfig,
      add_pooling_layer: bool = True,
      **kwargs,
  ):
      super().__init__(**kwargs)
  
      self.config = config
      self.embeddings = TFConvNextEmbeddings(config, name="embeddings")
      self.encoder = TFConvNextEncoder(config, name="encoder")
      self.layernorm = tf.keras.layers.LayerNormalization(
          epsilon=config.layer_norm_eps, name="layernorm"
      )
      # We are setting the `data_format` like so because from here on we will revert to the
      # NCHW output format
      self.pooler = (
          tf.keras.layers.GlobalAvgPool2D(data_format="channels_first")
          if add_pooling_layer
          else None
      )
  
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 TFConvNextMainLayer object from inherited base classes: tf.keras.layers with example: obj = TFConvNextMainLayer(config, add_pooling_layer)