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

bump tensorflow to 2.15 in CI #4847

Merged
merged 3 commits into from
Nov 16, 2023
Merged

bump tensorflow to 2.15 in CI #4847

merged 3 commits into from
Nov 16, 2023

Conversation

timmysilv
Copy link
Contributor

@timmysilv timmysilv commented Nov 15, 2023

For some reason in 2.15, the ndim() of an abstract tensor with shape specified as None was -1, so it didn't raise an error, and didn't get handled with this exception handling

Description of the change
qml.math.ndim(tensor) always returns len(tensor.shape) for tensorflow. this will still raise errors as expected for abstract tensors with abstract shapes (only happens when the user specifies the shape as None before compiling a function).

ran a bunch of tests (tf interface tests, the tf.function test that failed in test_operation.py) locally with python 3.9, TF 2.10 just to make sure I didn't break old versions of tensorflow, they all passed 🙌

Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

Copy link

codecov bot commented Nov 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (bce513e) 99.65% compared to head (d28de6c) 99.66%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4847   +/-   ##
=======================================
  Coverage   99.65%   99.66%           
=======================================
  Files         382      382           
  Lines       34507    34501    -6     
=======================================
- Hits        34389    34384    -5     
+ Misses        118      117    -1     

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

@timmysilv timmysilv requested review from trbromley and a team November 15, 2023 22:16
@albi3ro
Copy link
Contributor

albi3ro commented Nov 15, 2023

Great job finding this :) does it still work on older tf versions?

@timmysilv
Copy link
Contributor Author

timmysilv commented Nov 16, 2023

I did:

pip install tensorflow-macos==2.10
pytest tests/interfaces/default_qubit_2_integration/test_tensorflow_qnode_default_qubit_2.py \
    tests/test_operation.py::TestBroadcasting::test_with_tf_function

with python 3.9, and it passed

@timmysilv timmysilv requested a review from a team November 16, 2023 14:01
@trbromley trbromley added the ci:run-full-test-suite Run the full test-suite on the pull request label Nov 16, 2023
@timmysilv timmysilv merged commit 93a8716 into master Nov 16, 2023
@timmysilv timmysilv deleted the bump-tf-2-15 branch November 16, 2023 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:run-full-test-suite Run the full test-suite on the pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants