Skip to content
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

Fixes for reference before assignment… #18640

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

SamuelMarks
Copy link
Contributor

found through static analysis tooling

(more to go; or you can merge now and await further PRs; or you can request I move this to one PR per file or per module)

@gbaned gbaned added this to Assigned Reviewer in PR Queue via automation Oct 18, 2023
@gbaned gbaned requested a review from fchollet October 18, 2023 05:43
@sachinprasadhs sachinprasadhs added the keras-team-review-pending Pending review by a Keras team member. label Oct 18, 2023
@fchollet
Copy link
Member

Thanks for the PR. Unit tests are failing and the value-add of most of these changes is highly questionable (most of it is unreachable code which will only serve to decrease our coverage). Please double check each change and only keep the useful ones.

@fchollet fchollet removed the keras-team-review-pending Pending review by a Keras team member. label Oct 21, 2023
@@ -602,6 +602,8 @@ def get_config(self):
learning_rate = serialization_lib.serialize_keras_object(
self._learning_rate
)
else:
learning_rate = 0.5
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this should be?

…Close` from `test_tf_data_compatibility` ; [keras/{ops/numpy.py,saving/saving_lib.py}] `black`en
@SamuelMarks
Copy link
Contributor Author

@fchollet Hmm ok I'll see what's causing these segfaults. In the meantime a lot of the patches are to solve the traceability problem, i.e., guarantee that the output variable is constructed as per below:

-        for output in ds.take(1):
-            output = output.numpy()
+        output = next(iter(ds)).numpy()

Should I change the PR to just that fix, and make separate PR(s) for the other cases?

@sachinprasadhs sachinprasadhs added the stat:awaiting keras-eng Awaiting response from Keras engineer label Oct 25, 2023
@gbaned
Copy link
Collaborator

gbaned commented Dec 1, 2023

Hi @SamuelMarks Can you please resolve conflicts? Thank you!

# Conflicts:
#	keras/layers/preprocessing/center_crop_test.py
#	keras/layers/preprocessing/random_crop_test.py
#	keras/layers/preprocessing/random_rotation_test.py
#	keras/layers/preprocessing/random_zoom_test.py
#	keras/layers/preprocessing/resizing_test.py
@SamuelMarks
Copy link
Contributor Author

@gbaned - Sure thing. Done.

@codecov-commenter
Copy link

codecov-commenter commented Dec 6, 2023

Codecov Report

Attention: Patch coverage is 50.00000% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 75.93%. Comparing base (1941c30) to head (040582f).

Files Patch % Lines
keras/src/applications/densenet.py 0.00% 2 Missing ⚠️
keras/src/models/model.py 33.33% 2 Missing ⚠️
keras/src/backend/torch/trainer.py 0.00% 1 Missing ⚠️
keras/src/layers/attention/attention.py 0.00% 1 Missing ⚠️
keras/src/legacy/backend.py 0.00% 1 Missing ⚠️
keras/src/optimizers/base_optimizer.py 0.00% 1 Missing ⚠️
keras/src/tree/dmtree_impl.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #18640      +/-   ##
==========================================
- Coverage   78.38%   75.93%   -2.45%     
==========================================
  Files         498      498              
  Lines       45520    45530      +10     
  Branches     8393     8388       -5     
==========================================
- Hits        35679    34572    -1107     
- Misses       8102     9131    +1029     
- Partials     1739     1827      +88     
Flag Coverage Δ
keras 75.85% <50.00%> (-2.38%) ⬇️
keras-jax 64.98% <50.00%> (+2.97%) ⬆️
keras-numpy 56.49% <38.88%> (+0.15%) ⬆️
keras-tensorflow 66.33% <44.44%> (+2.97%) ⬆️
keras-torch ?
keras.applications 80.34% <0.00%> (?)
keras.applications-jax 80.34% <0.00%> (?)
keras.applications-numpy 22.91% <0.00%> (?)
keras.applications-tensorflow 80.34% <0.00%> (?)
keras.applications-torch 80.08% <0.00%> (?)

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.

…rop_test,random_crop_test}

ops/operation}.py] Resolve issues found through `flake8 --config setup.cfg .`
@gbaned
Copy link
Collaborator

gbaned commented Dec 29, 2023

Hi @SamuelMarks Can you please resolve conflicts? Thank you!

@SamuelMarks
Copy link
Contributor Author

@gbaned Done

@sachinprasadhs sachinprasadhs added the stat:awaiting keras-eng Awaiting response from Keras engineer label Jan 17, 2024
@sachinprasadhs
Copy link
Collaborator

sachinprasadhs commented May 1, 2024

@SamuelMarks , Can you please rebase the code to the latest code structure, eg: keras/layers is now keras/src/layers

@sachinprasadhs sachinprasadhs added stat:awaiting response from contributor and removed stat:awaiting keras-eng Awaiting response from Keras engineer labels May 1, 2024
# Conflicts:
#	examples/keras_io/timeseries/timeseries_weather_forecasting.py
#	keras/layers/preprocessing/category_encoding_test.py
#	keras/layers/preprocessing/discretization_test.py
#	keras/layers/preprocessing/random_brightness_test.py
#	keras/src/layers/preprocessing/category_encoding.py
#	keras/src/ops/operation.py
#	keras/src/ops/operation_utils.py
#	keras/src/trainers/epoch_iterator.py
@SamuelMarks
Copy link
Contributor Author

@sachinprasadhs No problem. Merged and resolved conflicts.

@sachinprasadhs sachinprasadhs added the stat:awaiting keras-eng Awaiting response from Keras engineer label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review size:S stat:awaiting keras-eng Awaiting response from Keras engineer
Projects
PR Queue
Assigned Reviewer
Development

Successfully merging this pull request may close these issues.

None yet

5 participants