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

SVD operation failed when compute_uv=False (TF backend) #20094

Closed
cofri opened this issue Aug 7, 2024 · 1 comment · Fixed by #20122
Closed

SVD operation failed when compute_uv=False (TF backend) #20094

cofri opened this issue Aug 7, 2024 · 1 comment · Fixed by #20122
Assignees
Labels
keras-team-review-pending Pending review by a Keras team member. type:Bug

Comments

@cofri
Copy link
Contributor

cofri commented Aug 7, 2024

Problem raised

TensorFlow tf.linalg.svd() with compute_uv=False returns a single tensor containing the singular values, and not three tensors "s, u, v" when compute_uv=True.
However, code line 188 in keras/src/backend/tensorflow/linalg.py always expects three returned tensors, even if only one is expected when compute_uv=False. It raises a ValueError: not enough values to unpack.

s, u, v = tf.linalg.svd(
)

Tested versions:

  • Keras 3.4.1
  • TensorFlow 2.17.0

Code to reproduce:

import keras
keras.ops.svd([[1.0, 0.0], [2.0, 0.0]], compute_uv=False)
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keras-team-review-pending Pending review by a Keras team member. type:Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants