code: def __init__(self, config: XGLMConfig, **kwargs: Any) -> None:
      super().__init__(**kwargs)
      self.embed_dim = config.d_model
      self.self_attn = TFXGLMAttention(
          embed_dim=self.embed_dim,
          num_heads=config.attention_heads,
          dropout=config.attention_dropout,
          is_decoder=True,
          name="self_attn",
      )
      self.dropout = tf.keras.layers.Dropout(config.dropout)
      self.activation_fn = get_tf_activation(config.activation_function)
      self.activation_dropout = tf.keras.layers.Dropout(
          config.activation_dropout
      )
  
      if config.add_cross_attention:
          self.encoder_attn = TFXGLMAttention(
              embed_dim=self.embed_dim,
              num_heads=config.attention_heads,
              dropout=config.attention_dropout,
              is_decoder=True,
              name="encoder_attn",
          )
          self.encoder_attn_layer_norm = (
              tf.keras.layers.LayerNormalization(
                  epsilon=1e-5, name="encoder_attn_layer_norm"
              )
          )
  
      self.self_attn_layer_norm = tf.keras.layers.LayerNormalization(
          epsilon=1e-5, name="self_attn_layer_norm"
      )
      self.fc1 = tf.keras.layers.Dense(config.ffn_dim, name="fc1")
      self.fc2 = tf.keras.layers.Dense(self.embed_dim, name="fc2")
      self.final_layer_norm = tf.keras.layers.LayerNormalization(
          epsilon=1e-5, name="final_layer_norm"
      )
  
imports: import math
  import random
  from typing import Any, Optional, Tuple, Union
  import numpy
  import tensorflow
  from ...activations_tf import get_tf_activation
  from ...file_utils import DUMMY_INPUTS, add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward, replace_return_docstrings
  from ...modeling_tf_outputs import TFBaseModelOutputWithPastAndCrossAttentions, TFCausalLMOutputWithCrossAttentions
  from ...modeling_tf_utils import TFCausalLanguageModelingLoss, TFModelInputType, TFPreTrainedModel, TFSharedEmbeddings, get_initializer, keras_serializable, unpack_inputs
  from ...tf_utils import shape_list, stable_softmax
  from ...utils import logging
  from .configuration_xglm import XGLMConfig
label_desc: Use image node_id 1 to create a new TFXGLMDecoderLayer object from inherited base classes: tf.keras.layers with example: obj = TFXGLMDecoderLayer(config)