Skip to content

Fix optree regsitration #21049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

mattdangerw
Copy link
Member

The following will break as reimporting Keras will try to re-register the Tensorflow list/dict wrappers. Presumably anything that forced an actual reimport of keras would trigger the same crash.

import keras

keras.config.set_backend("tensorflow")

The following will break as reimporting Keras will try to re-register
the Tensorflow list/dict wrappers. Presumably anything that forced an
actual reimport of `keras` would trigger the same crash.

```python
import keras

keras.config.set_backend("tensorflow")
```
@codecov-commenter
Copy link

codecov-commenter commented Mar 16, 2025

Codecov Report

Attention: Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.

Project coverage is 82.47%. Comparing base (6e688ab) to head (dd0eaa6).

Files with missing lines Patch % Lines
keras/src/tree/optree_impl.py 77.77% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #21049      +/-   ##
==========================================
- Coverage   82.47%   82.47%   -0.01%     
==========================================
  Files         563      563              
  Lines       53834    53837       +3     
  Branches     8359     8359              
==========================================
+ Hits        44401    44402       +1     
- Misses       7392     7394       +2     
  Partials     2041     2041              
Flag Coverage Δ
keras 82.29% <77.77%> (-0.01%) ⬇️
keras-jax 63.79% <0.00%> (-0.01%) ⬇️
keras-numpy 58.75% <0.00%> (-0.01%) ⬇️
keras-openvino 32.71% <0.00%> (-0.01%) ⬇️
keras-tensorflow 64.11% <77.77%> (-0.01%) ⬇️
keras-torch 63.83% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@google-ml-butler google-ml-butler bot added kokoro:force-run ready to pull Ready to be merged into the codebase labels Mar 17, 2025
@fchollet fchollet merged commit dac30fa into keras-team:master Mar 17, 2025
11 checks passed
@google-ml-butler google-ml-butler bot removed awaiting review ready to pull Ready to be merged into the codebase kokoro:force-run labels Mar 17, 2025
Hmm-1224 pushed a commit to Hmm-1224/keras that referenced this pull request Apr 5, 2025
The following will break as reimporting Keras will try to re-register
the Tensorflow list/dict wrappers. Presumably anything that forced an
actual reimport of `keras` would trigger the same crash.

```python
import keras

keras.config.set_backend("tensorflow")
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants