code: def _prepare_decoder_attention_mask(
      self, attention_mask, input_shape, past_key_values_length
  ):
      # create causal mask
      # # [bsz, seq_len] -> [bsz, 1, tgt_seq_len, src_seq_len]
      combined_attention_mask = None
      if input_shape[-1] > 1:
          combined_attention_mask = _make_causal_mask(
              input_shape, past_key_values_length=past_key_values_length
          )
      else:
          combined_attention_mask = _expand_mask(
              tf.ones(
                  (
                      input_shape[0],
                      input_shape[1] + past_key_values_length,
                  )
              ),
              tgt_len=input_shape[-1],
          )
  
      if attention_mask is not None:
          combined_attention_mask = (
              combined_attention_mask
              + _expand_mask(attention_mask, tgt_len=input_shape[-1])
          )
  
      return combined_attention_mask
  
imports: from typing import Optional, Tuple, Union
  import numpy
  import tensorflow
  from ...activations_tf import get_tf_activation
  from ...modeling_tf_outputs import TFBaseModelOutputWithPast, TFCausalLMOutputWithPast
  from ...modeling_tf_utils import DUMMY_INPUTS, TFCausalLanguageModelingLoss, TFModelInputType, TFPreTrainedModel, TFSharedEmbeddings, keras_serializable, unpack_inputs
  from ...tf_utils import shape_list, stable_softmax
  from ...utils import add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward, logging, replace_return_docstrings
  from .configuration_opt import OPTConfig
label_desc: Use image node_id 6 for calling the TFOPTDecoder obj's underlying member method code with example usage: obj._prepare_decoder_attention_mask(attention_mask, input_shape, past_key_values_length) and returns: combined_attention_mask