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

Add integration test for backend-specific imports #945

Closed nkovela1 closed 10 months ago

nkovela1 commented 10 months ago

This PR adds an integration test to ensure that backend-specific imports are not used.

It works by creating a virtual environment where only one backend's packages are installed and then testing a basic subclassed model.fit() flow.

We can integrate this with CI in the next PR or this one.

codecov[bot] commented 10 months ago

Codecov Report

Patch coverage has no change and project coverage change: -11.55% :warning:

Comparison is base (180e134) 83.82% compared to head (347b3d7) 72.28%. Report is 15 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #945 +/- ## =========================================== - Coverage 83.82% 72.28% -11.55% =========================================== Files 318 319 +1 Lines 28737 28879 +142 Branches 5489 5529 +40 =========================================== - Hits 24090 20874 -3216 - Misses 3141 6620 +3479 + Partials 1506 1385 -121 ``` | [Flag](https://app.codecov.io/gh/keras-team/keras-core/pull/945/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/945/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `72.22% <ø> (-11.50%)` | :arrow_down: | | [keras_core-jax](https://app.codecov.io/gh/keras-team/keras-core/pull/945/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `?` | | | [keras_core-numpy](https://app.codecov.io/gh/keras-team/keras-core/pull/945/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `60.56% <ø> (-0.08%)` | :arrow_down: | | [keras_core-tensorflow](https://app.codecov.io/gh/keras-team/keras-core/pull/945/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `67.01% <ø> (+0.04%)` | :arrow_up: | | [keras_core-torch](https://app.codecov.io/gh/keras-team/keras-core/pull/945/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. [see 70 files with indirect coverage changes](https://app.codecov.io/gh/keras-team/keras-core/pull/945/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.

fchollet commented 10 months ago

Thanks for the PR! Please reopen it in keras-team/keras.