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
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/interface-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
description: The version of TensorFlow to install for any job that requires TensorFlow
required: false
type: string
default: 2.13.0
default: 2.15.0
pytorch_version:
description: The version of PyTorch to install for any job that requires PyTorch
required: false
Expand Down
10 changes: 2 additions & 8 deletions pennylane/math/single_dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import semantic_version
from scipy.linalg import block_diag as _scipy_block_diag

from .utils import get_deep_interface
from .utils import get_deep_interface, is_abstract


def _i(name):
Expand Down Expand Up @@ -335,13 +335,7 @@ def _round_tf(tensor, decimals=0):


def _ndim_tf(tensor):
try:
ndim = _i("tf").experimental.numpy.ndim(tensor)
if ndim is None:
return len(tensor.shape)
return ndim
except AttributeError:
return len(tensor.shape)
return len(tensor.shape) if is_abstract(tensor) else int(_i("tf").rank(tensor))


ar.register_function("tensorflow", "ndim", _ndim_tf)
Expand Down