class_docstr: Transformer decoder consisting of *config.num_layers* layers. Each layer is a [`TFXGLMDecoderLayer`]
  
  Args:
      config: XGLMConfig
      embed_tokens: [TFSharedEmbeddings]: output embedding
code: def serving_output(self, output):
      pkv = (
          tf.convert_to_tensor(output.past_key_values)
          if self.config.use_cache
          else None
      )
      hs = (
          tf.convert_to_tensor(output.hidden_states)
          if self.config.output_hidden_states
          else None
      )
      attns = (
          tf.convert_to_tensor(output.attentions)
          if self.config.output_attentions
          else None
      )
      cross_attns = (
          tf.convert_to_tensor(output.cross_attentions)
          if self.config.output_attentions
          and self.config.add_cross_attention
          else None
      )
  
      return TFBaseModelOutputWithPastAndCrossAttentions(
          last_hidden_state=output.hidden_states,
          past_key_values=pkv,
          hidden_states=hs,
          attentions=attns,
          cross_attentions=cross_attns,
      )
  
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 3 for calling the TFXGLMModel obj's underlying member method code with example usage: obj.serving_output(output) and returns: TFBaseModelOutputWithPastAndCrossAttentions