keras-team / keras

Deep Learning for humans
http://keras.io/
Apache License 2.0
62.12k stars 19.49k forks source link

More flexible output_shape computation in keras.layers.MultiHeadAttention #20503

Closed lcs-crr closed 4 days ago

lcs-crr commented 6 days ago

Made the compute_output_shape method more flexible; now _output_shape can be either an integer or a tuple (as previously required).

Fix discussed at the bottom of issue #19769

codecov-commenter commented 6 days ago

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 82.11%. Comparing base (1354fde) to head (eabc535). Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
keras/src/layers/attention/multi_head_attention.py 33.33% 1 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #20503 +/- ## ======================================= Coverage 82.10% 82.11% ======================================= Files 515 515 Lines 47670 47717 +47 Branches 7468 7476 +8 ======================================= + Hits 39141 39184 +43 - Misses 6721 6724 +3 - Partials 1808 1809 +1 ``` | [Flag](https://app.codecov.io/gh/keras-team/keras/pull/20503/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | Coverage Δ | | |---|---|---| | [keras](https://app.codecov.io/gh/keras-team/keras/pull/20503/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `81.96% <33.33%> (+<0.01%)` | :arrow_up: | | [keras-jax](https://app.codecov.io/gh/keras-team/keras/pull/20503/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `65.04% <33.33%> (-0.01%)` | :arrow_down: | | [keras-numpy](https://app.codecov.io/gh/keras-team/keras/pull/20503/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `60.01% <33.33%> (-0.01%)` | :arrow_down: | | [keras-tensorflow](https://app.codecov.io/gh/keras-team/keras/pull/20503/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `66.03% <33.33%> (-0.01%)` | :arrow_down: | | [keras-torch](https://app.codecov.io/gh/keras-team/keras/pull/20503/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `64.96% <33.33%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

lcs-crr commented 5 days ago

Unsure why code format test fails... In it, it says All checks passed!