docstr: labels (`np.ndarray` or `tf.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
      Labels for language modeling. Note that the labels **are shifted** inside the model, i.e. you can set
      `labels = input_ids` Indices are selected in `[-100, 0, ..., config.vocab_size]` All labels set to `-100`
      are ignored (masked), the loss is only computed for labels in `[0, ..., config.vocab_size]`
docstr_tok: ["labels","(","`","np.ndarray","`","or","`","tf.Tensor","`","of","shape","`","(","batch_size",",","sequence_length",")","`",",","*","optional","*",")",":","Labels","for","language","modeling",".","Note","that","the","labels","*","*","are","shifted","*","*","inside","the","model",",","i.e",".","you","can","set","`","labels","=","input_ids","`","Indices","are","selected","in","`","[","-100",",","0",",","...",",","config.vocab_size","]","`","All","labels","set","to","`","-100","`","are","ignored","(","masked",")",",","the","loss","is","only","computed","for","labels","in","`","[","0",",","...",",","config.vocab_size","]","`"]
code: def call(
      self,
      input_ids: Optional[TFModelInputType] = None,
      past_key_values: Optional[
          Tuple[Tuple[Union[np.ndarray, tf.Tensor]]]
      ] = None,
      attention_mask: Optional[Union[np.ndarray, tf.Tensor]] = None,
      token_type_ids: Optional[Union[np.ndarray, tf.Tensor]] = None,
      position_ids: Optional[Union[np.ndarray, tf.Tensor]] = None,
      head_mask: Optional[Union[np.ndarray, tf.Tensor]] = None,
      inputs_embeds: Optional[Union[np.ndarray, tf.Tensor]] = None,
      labels: Optional[Union[np.ndarray, tf.Tensor]] = None,
      use_cache: Optional[bool] = None,
      output_attentions: Optional[bool] = None,
      output_hidden_states: Optional[bool] = None,
      return_dict: Optional[bool] = None,
      training: Optional[bool] = False,
  ) -> Union[TFCausalLMOutputWithPast, Tuple[tf.Tensor]]:
      r"""
      labels (`np.ndarray` or `tf.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
          Labels for language modeling. Note that the labels **are shifted** inside the model, i.e. you can set
          `labels = input_ids` Indices are selected in `[-100, 0, ..., config.vocab_size]` All labels set to `-100`
          are ignored (masked), the loss is only computed for labels in `[0, ..., config.vocab_size]`
      """
  
      transformer_outputs = self.transformer(
          input_ids=input_ids,
          past_key_values=past_key_values,
          attention_mask=attention_mask,
          token_type_ids=token_type_ids,
          position_ids=position_ids,
          head_mask=head_mask,
          inputs_embeds=inputs_embeds,
          use_cache=use_cache,
          output_attentions=output_attentions,
          output_hidden_states=output_hidden_states,
          return_dict=return_dict,
          training=training,
      )
      hidden_states = transformer_outputs[0]
      lm_logits = self.lm_head(hidden_states)
  
      loss = None
      if labels is not None:
          # shift labels to the left and cut last logit token
          shifted_logits = lm_logits[:, :-1]
          labels = labels[:, 1:]
          loss = self.hf_compute_loss(labels, shifted_logits)
  
      if not return_dict:
          output = (lm_logits,) + transformer_outputs[1:]
          return ((loss,) + output) if loss is not None else output
  
      return TFCausalLMOutputWithPast(
          loss=loss,
          logits=lm_logits,
          past_key_values=transformer_outputs.past_key_values,
          hidden_states=transformer_outputs.hidden_states,
          attentions=transformer_outputs.attentions,
      )
  
imports: from typing import 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
  from ...modeling_tf_outputs import TFBaseModelOutputWithPast, TFCausalLMOutputWithPast, TFQuestionAnsweringModelOutput, TFSequenceClassifierOutputWithPast
  from ...modeling_tf_utils import TFCausalLanguageModelingLoss, TFModelInputType, TFPreTrainedModel, TFQuestionAnsweringLoss, TFSequenceClassificationLoss, TFSharedEmbeddings, get_initializer, keras_serializable, unpack_inputs
  from ...tf_utils import shape_list, stable_softmax
  from ...utils import logging
  from .configuration_gptj import GPTJConfig
label_desc: Use image node_id 5 for calling the TFGPTJForCausalLM obj's underlying member method code with example usage: obj.call(input_ids, past_key_values, attention_mask, token_type_ids, position_ids, head_mask, inputs_embeds, labels, use_cache, output_attentions, output_hidden_states, return_dict, training) and returns: TFCausalLMOutputWithPast, unknown