code: def test_lm_forward(self):
      config, input_ids, batch_size = self._get_config_and_data()
      decoder_lm_labels = ids_tensor(
          [batch_size, input_ids.shape[1]], self.vocab_size
      )
      lm_model = TFBartForConditionalGeneration(config)
      outputs = lm_model(
          input_ids=input_ids,
          labels=decoder_lm_labels,
          decoder_input_ids=input_ids,
          use_cache=False,
      )
      expected_shape = (
          batch_size,
          input_ids.shape[1],
          config.vocab_size,
      )
      self.assertEqual(outputs.logits.shape, expected_shape)
  
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 2 for calling the TFBartHeadTests obj's underlying member method code with example usage: obj.test_lm_forward() without return types