code: def test_training_summarizer_attention(self) -> None:
      attention_summarizer = AttentionSummarizer(
          lstm_size=10, embedding_size=10
      )
      attention_summarizer.init_model(
          preprocessor=self.preprocessor,
          vectorizer=self.vectorizer,
          embedding_weights_encoder=None,
          embedding_weights_decoder=None,
      )
      loss_attention = 0
      train_step = attention_summarizer.new_train_step(
          loss_function=self.loss_func, batch_size=2
      )
      for _ in range(10):
          for source_seq, target_seq in self.dataset.take(-1):
              loss_attention = train_step(source_seq, target_seq)
              print(str(loss_attention))
  
      self.assertAlmostEqual(
          1.577033519744873, float(loss_attention), 5
      )
      output_attention = attention_summarizer.predict_vectors("a c", "")
      expected_first_logits = np.array(
          [-0.077805, 0.012667, 0.021359, -0.04872, 0.014989]
      )
      np.testing.assert_allclose(
          expected_first_logits,
          output_attention["logits"][0],
          atol=1e-6,
      )
      self.assertEqual(
          "<start> a c <end>", output_attention["preprocessed_text"][0]
      )
      self.assertEqual("d <end>", output_attention["predicted_text"])
  
file_path: headliner/tests/test_training.py
imports: import unittest
  import numpy
  import tensorflow
  from headliner.losses import masked_crossentropy
  from headliner.model.basic_summarizer import BasicSummarizer
  from headliner.model.attention_summarizer import AttentionSummarizer
  from headliner.model.transformer_summarizer import TransformerSummarizer
  from headliner.preprocessing.dataset_generator import DatasetGenerator
  from headliner.preprocessing.keras_tokenizer import KerasTokenizer
  from headliner.preprocessing.preprocessor import Preprocessor
  from headliner.preprocessing.vectorizer import Vectorizer
label_desc: Use image node_id 2 for calling the TestTraining obj's underlying member method code with example usage: obj.test_training_summarizer_attention() without return types