code: def prepare_led_inputs_dict(
      config,
      input_ids,
      decoder_input_ids,
      attention_mask=None,
      decoder_attention_mask=None,
      head_mask=None,
      decoder_head_mask=None,
  ):
      if attention_mask is None:
          attention_mask = tf.cast(
              tf.math.not_equal(input_ids, config.pad_token_id), tf.int8
          )
      if decoder_attention_mask is None:
          decoder_attention_mask = tf.concat(
              [
                  tf.ones(
                      decoder_input_ids[:, :1].shape, dtype=tf.int8
                  ),
                  tf.cast(
                      tf.math.not_equal(
                          decoder_input_ids[:, 1:], config.pad_token_id
                      ),
                      tf.int8,
                  ),
              ],
              axis=-1,
          )
      if head_mask is None:
          head_mask = tf.ones(
              (config.encoder_layers, config.encoder_attention_heads)
          )
      if decoder_head_mask is None:
          decoder_head_mask = tf.ones(
              (config.decoder_layers, config.decoder_attention_heads)
          )
      return {
          "input_ids": input_ids,
          "attention_mask": attention_mask,
          "decoder_input_ids": decoder_input_ids,
          "decoder_attention_mask": decoder_attention_mask,
          "head_mask": head_mask,
          "decoder_head_mask": decoder_head_mask,
      }
  
imports: import unittest
  from transformers import LEDConfig, is_tf_available
  from transformers.testing_utils import require_tf, slow, tooslow
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor
label_desc: Use image node_id 1 for calling a global function with example usage: prepare_led_inputs_dict(config, input_ids, decoder_input_ids, attention_mask, decoder_attention_mask, head_mask, decoder_head_mask) and returns: dict