keras-team / keras-core

A multi-backend implementation of the Keras API, with support for TensorFlow, JAX, and PyTorch.
Apache License 2.0
1.27k stars 115 forks source link

Fix autocast scope again #849

Closed mattdangerw closed 1 year ago

mattdangerw commented 1 year ago

Sometimes in preprocessing layers our dtype is not a floating point dtype. In these cases we should never autocast, it would error immediately.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01% :tada:

Comparison is base (ab45558) 75.99% compared to head (d017df7) 76.01%. Report is 4 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #849 +/- ## ========================================== + Coverage 75.99% 76.01% +0.01% ========================================== Files 328 328 Lines 31099 31105 +6 Branches 6051 6053 +2 ========================================== + Hits 23635 23644 +9 + Misses 5866 5864 -2 + Partials 1598 1597 -1 ``` | [Flag](https://app.codecov.io/gh/keras-team/keras-core/pull/849/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | Coverage Δ | | |---|---|---| | [keras_core](https://app.codecov.io/gh/keras-team/keras-core/pull/849/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `75.92% <100.00%> (+0.01%)` | :arrow_up: | 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. | [Files Changed](https://app.codecov.io/gh/keras-team/keras-core/pull/849?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | Coverage Δ | | |---|---|---| | [keras\_core/layers/layer.py](https://app.codecov.io/gh/keras-team/keras-core/pull/849?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team#diff-a2VyYXNfY29yZS9sYXllcnMvbGF5ZXIucHk=) | `87.05% <100.00%> (+0.04%)` | :arrow_up: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/keras-team/keras-core/pull/849/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team)

:umbrella: View full report in Codecov by Sentry.

:loudspeaker: Have feedback on the report? Share it here.

mattdangerw commented 1 year ago

Done!