keras-team / keras

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

Fix `ops.shape()` for `tf.RaggedTensor`. #19707

Closed hertschuh closed 3 weeks ago

hertschuh commented 3 weeks ago

With the TensorFlow backend, when passing a RaggedTensor, the dynamic shape returned by tf.shape is an object that raises an exception when a ragged dimension is accessed. We catch it and leave the dimension as None.

codecov-commenter commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 68.82%. Comparing base (8bd4cc0) to head (45c1035).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #19707 +/- ## ========================================== - Coverage 78.52% 68.82% -9.71% ========================================== Files 498 498 Lines 45763 45769 +6 Branches 8455 8456 +1 ========================================== - Hits 35936 31499 -4437 - Misses 8092 12681 +4589 + Partials 1735 1589 -146 ``` | [Flag](https://app.codecov.io/gh/keras-team/keras/pull/19707/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/19707/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `68.75% <100.00%> (-9.62%)` | :arrow_down: | | [keras-jax](https://app.codecov.io/gh/keras-team/keras/pull/19707/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `61.94% <77.77%> (+<0.01%)` | :arrow_up: | | [keras-numpy](https://app.codecov.io/gh/keras-team/keras/pull/19707/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `?` | | | [keras-tensorflow](https://app.codecov.io/gh/keras-team/keras/pull/19707/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `63.43% <100.00%> (+0.01%)` | :arrow_up: | | [keras-torch](https://app.codecov.io/gh/keras-team/keras/pull/19707/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `?` | | 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.