Commit 65669c0e authored by Yong Tang's avatar Yong Tang Committed by Rasmus Munk Larsen
Browse files

Fix issue with Luong attention when scale=True and dtype of tf.float16/tf.float64 (#18106)



* Fix issue with Luong attention when scale=True and dtype=tf.float16/tf.float64

This fix tries to address the issue raised in 18099 where
Luong throws a ValueError when scale=True and dtype is not tf.float32.

This fix addresses the issue with the additional test case added.

This fix fixes 18099.

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Fix pylint issue

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Add test case for Luong attention with scale=True and dtype=float16/float64

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Add assertEqual to confirm the dtypes of the output

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>
parent 8328d84f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment