From 93af5d010878f2a9a46317fe7cba172131e3d055 Mon Sep 17 00:00:00 2001 From: keerthanakadiri <147126008+keerthanakadiri@users.noreply.github.com> Date: Thu, 2 Jan 2025 10:40:54 +0530 Subject: [PATCH] Fix typos in additive_attention I observed a few typos in additive_attention --- keras/src/layers/attention/additive_attention.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keras/src/layers/attention/additive_attention.py b/keras/src/layers/attention/additive_attention.py index 787dd50e71a..44c13ac2b86 100644 --- a/keras/src/layers/attention/additive_attention.py +++ b/keras/src/layers/attention/additive_attention.py @@ -10,7 +10,7 @@ class AdditiveAttention(Attention): Inputs are a list with 2 or 3 elements: 1. A `query` tensor of shape `(batch_size, Tq, dim)`. 2. A `value` tensor of shape `(batch_size, Tv, dim)`. - 3. A optional `key` tensor of shape `(batch_size, Tv, dim)`. If none + 3. An optional `key` tensor of shape `(batch_size, Tv, dim)`. If none supplied, `value` will be used as `key`. The calculation follows the steps: @@ -33,7 +33,7 @@ class AdditiveAttention(Attention): - `query`: Query tensor of shape `(batch_size, Tq, dim)`. - `value`: Value tensor of shape `(batch_size, Tv, dim)`. - `key`: Optional key tensor of shape `(batch_size, Tv, dim)`. If - not given, will use `value` for both `key` and `value`, which is + not given, will use the`value` for both `key` and `value`, which is the most common case. mask: List of the following tensors: - `query_mask`: A boolean mask tensor of shape `(batch_size, Tq)`.