def test_return_attention_scores_true_and_tuple(self):
        """Test that the layer outputs are a tuple when
        return_attention_scores=True."""
        # Generate dummy input data
        query = np.random.random((2, 8, 16)).astype(np.float32)
        value = np.random.random((2, 4, 16)).astype(np.float32)

        # Initialize the Attention layer
        layer = layers.Attention()

        # Call the layer with return_attention_scores=True
        outputs = layer([query, value], return_attention_scores=True)

        # Check that outputs is a tuple
        self.assertIsInstance(
            outputs, tuple, "Expected the outputs to be a tuple"
        )
Test that the layer outputs are a tuple when
        return_attention_scores=True.
keras/src/layers/attention/attention_test.py