keras-team / keras

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

Replace `np.iinfo` and `np.finfo` with `ml_dtypes` #20528

Closed james77777778 closed 1 day ago

james77777778 commented 1 day ago

np.finfo fails when encountering bfloat16. With ml_dtypes, we can improve compatibility.

codecov-commenter commented 1 day ago

Codecov Report

Attention: Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 82.11%. Comparing base (495a570) to head (2e18458).

Files with missing lines Patch % Lines
keras/src/ops/core.py 94.11% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #20528 +/- ## ======================================= Coverage 82.11% 82.11% ======================================= Files 515 515 Lines 47790 47802 +12 Branches 7486 7488 +2 ======================================= + Hits 39242 39254 +12 Misses 6736 6736 Partials 1812 1812 ``` | [Flag](https://app.codecov.io/gh/keras-team/keras/pull/20528/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/20528/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `81.96% <95.00%> (+<0.01%)` | :arrow_up: | | [keras-jax](https://app.codecov.io/gh/keras-team/keras/pull/20528/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `65.06% <80.00%> (+<0.01%)` | :arrow_up: | | [keras-numpy](https://app.codecov.io/gh/keras-team/keras/pull/20528/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `60.03% <90.00%> (+0.01%)` | :arrow_up: | | [keras-tensorflow](https://app.codecov.io/gh/keras-team/keras/pull/20528/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `66.03% <75.00%> (+<0.01%)` | :arrow_up: | | [keras-torch](https://app.codecov.io/gh/keras-team/keras/pull/20528/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `64.98% <75.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.

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


🚨 Try these New Features: