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 116 forks source link

Makes `ops.split` in torch consistent with other backends #914

Closed james77777778 closed 1 year ago

james77777778 commented 1 year ago

Fixes #544

Unit test has been updated to verify the behavior consistency across backends.

...
        # test zero dimension
        x = np.ones(shape=(0,))
        self.assertEqual(len(knp.split(x, 2)), 2)
        self.assertEqual(len(knp.Split(2)(x)), 2)
...
codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: -3.80% :warning:

Comparison is base (b4019bc) 83.63% compared to head (4b56db2) 79.83%. Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #914 +/- ## ========================================== - Coverage 83.63% 79.83% -3.80% ========================================== Files 318 318 Lines 28391 28591 +200 Branches 5409 5447 +38 ========================================== - Hits 23745 22827 -918 - Misses 3147 4297 +1150 + Partials 1499 1467 -32 ``` | [Flag](https://app.codecov.io/gh/keras-team/keras-core/pull/914/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/914/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `79.76% <100.00%> (-3.77%)` | :arrow_down: | | [keras_core-jax](https://app.codecov.io/gh/keras-team/keras-core/pull/914/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/914/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `60.46% <0.00%> (-0.27%)` | :arrow_down: | | [keras_core-tensorflow](https://app.codecov.io/gh/keras-team/keras-core/pull/914/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `66.90% <0.00%> (-0.18%)` | :arrow_down: | | [keras_core-torch](https://app.codecov.io/gh/keras-team/keras-core/pull/914/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | `69.30% <100.00%> (-0.14%)` | :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. | [Files Changed](https://app.codecov.io/gh/keras-team/keras-core/pull/914?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team) | Coverage Δ | | |---|---|---| | [keras\_core/backend/torch/numpy.py](https://app.codecov.io/gh/keras-team/keras-core/pull/914?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=keras-team#diff-a2VyYXNfY29yZS9iYWNrZW5kL3RvcmNoL251bXB5LnB5) | `95.17% <100.00%> (+0.04%)` | :arrow_up: | ... and [34 files with indirect coverage changes](https://app.codecov.io/gh/keras-team/keras-core/pull/914/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.

james77777778 commented 1 year ago

The JAX CI failure seems persistent, despite not occurring with local testing and having no clear connection to the commit where it started failing. We'll investigate it. There's something weird going on.

I could not reproduce these JAX CI failure in my local env, too.

It appears that this run has started to fail: https://github.com/keras-team/keras-core/actions/runs/6230566801/job/16910778781