docstr: labels (`tf.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
      Labels for computing the cross entropy classification loss. Indices should be in `[0, ...,
      config.vocab_size - 1]`.
docstr_tok: ["labels","(","`","tf.Tensor","`","of","shape","`","(","batch_size",",","sequence_length",")","`",",","*","optional","*",")",":","Labels","for","computing","the","cross","entropy","classification","loss",".","Indices","should","be","in","`","[","0",",","...",",","config.vocab_size","-","1","]","`","."]
code: def call(
      self,
      input_ids: TFModelInputType | None = None,
      attention_mask: np.ndarray | tf.Tensor | None = None,
      token_type_ids: np.ndarray | tf.Tensor | None = None,
      position_ids: np.ndarray | tf.Tensor | None = None,
      head_mask: np.ndarray | tf.Tensor | None = None,
      inputs_embeds: np.ndarray | tf.Tensor | None = None,
      output_attentions: Optional[bool] = None,
      output_hidden_states: Optional[bool] = None,
      return_dict: Optional[bool] = None,
      labels: np.ndarray | tf.Tensor | None = None,
      training: Optional[bool] = False,
  ) -> Union[Tuple, TFCausalLMOutput]:
      r"""
      labels (`tf.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
          Labels for computing the cross entropy classification loss. Indices should be in `[0, ...,
          config.vocab_size - 1]`.
      """
  
      transformer_outputs = self.transformer(
          input_ids=input_ids,
          attention_mask=attention_mask,
          token_type_ids=token_type_ids,
          position_ids=position_ids,
          head_mask=head_mask,
          inputs_embeds=inputs_embeds,
          output_attentions=output_attentions,
          output_hidden_states=output_hidden_states,
          return_dict=return_dict,
          training=training,
      )
      hidden_states = transformer_outputs[0]
  
      logits = self.transformer.tokens_embed(
          hidden_states, mode="linear"
      )
  
      loss = None
      if labels is not None:
          # shift labels to the left and cut last logit token
          shifted_logits = logits[:, :-1]
          labels = labels[:, 1:]
          loss = self.hf_compute_loss(labels, shifted_logits)
  
      if not return_dict:
          output = (logits,) + transformer_outputs[1:]
          return ((loss,) + output) if loss is not None else output
  
      return TFCausalLMOutput(
          loss=loss,
          logits=logits,
          hidden_states=transformer_outputs.hidden_states,
          attentions=transformer_outputs.attentions,
      )
  
imports: from __future__ import annotations
  from dataclasses import dataclass
  from typing import Optional, Tuple, Union
  import numpy
  import tensorflow
  from ...activations_tf import get_tf_activation
  from ...modeling_tf_outputs import TFBaseModelOutput, TFCausalLMOutput, TFSequenceClassifierOutput
  from ...modeling_tf_utils import TFCausalLanguageModelingLoss, TFConv1D, TFModelInputType, TFPreTrainedModel, TFSequenceClassificationLoss, TFSequenceSummary, TFSharedEmbeddings, get_initializer, keras_serializable, unpack_inputs
  from ...tf_utils import check_embeddings_within_bounds, shape_list, stable_softmax
  from ...utils import ModelOutput, add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward, logging, replace_return_docstrings
  from .configuration_openai import OpenAIGPTConfig
label_desc: Use image node_id 4 for calling the TFOpenAIGPTLMHeadModel obj's underlying member method code with example usage: obj.call(input_ids, attention_mask, token_type_ids, position_ids, head_mask, inputs_embeds, output_attentions, output_hidden_states, return_dict, labels, training) and returns: TFCausalLMOutput, unknown