code: def test_graph_mode_with_inputs_embeds(self):
      (
          config,
          inputs_dict,
      ) = self.model_tester.prepare_config_and_inputs_for_common()
  
      for model_class in (TFBartForConditionalGeneration, TFBartModel):
          model = model_class(config)
  
          inputs = copy.deepcopy(inputs_dict)
  
          if not self.is_encoder_decoder:
              input_ids = inputs["input_ids"]
              del inputs["input_ids"]
          else:
              encoder_input_ids = inputs["input_ids"]
              decoder_input_ids = inputs.get(
                  "decoder_input_ids", encoder_input_ids
              )
              del inputs["input_ids"]
              inputs.pop("decoder_input_ids", None)
  
          if not self.is_encoder_decoder:
              inputs["inputs_embeds"] = model.get_input_embeddings()(
                  input_ids
              )
          else:
              inputs["inputs_embeds"] = model.get_input_embeddings()(
                  encoder_input_ids
              )
              inputs[
                  "decoder_inputs_embeds"
              ] = model.get_input_embeddings()(decoder_input_ids)
  
          inputs = self._prepare_for_class(inputs, model_class)
  
          @tf.function
          def run_in_graph_mode():
              return model(inputs)
  
          outputs = run_in_graph_mode()
          self.assertIsNotNone(outputs)
  
imports: from __future__ import annotations
  import copy
  import tempfile
  import unittest
  import numpy
  from transformers import BartConfig, BartTokenizer, is_tf_available
  from transformers.testing_utils import require_tf, slow
  from transformers.utils import cached_property
  from ...test_configuration_common import ConfigTester
  from ...test_modeling_tf_common import TFModelTesterMixin, ids_tensor
  from ...test_pipeline_mixin import PipelineTesterMixin
  from ...utils.test_modeling_tf_core import TFCoreModelTesterMixin
label_desc: Use image node_id 6 for calling the TFBartModelTest obj's underlying member method code with example usage: obj.test_graph_mode_with_inputs_embeds() and returns: model