We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 084ac36 commit b9a49eaCopy full SHA for b9a49ea
keras/src/backend/tensorflow/linalg.py
@@ -169,7 +169,7 @@ def qr(x, mode="reduced"):
169
170
def solve(a, b):
171
# tensorflow.linalg.solve only supports same rank inputs
172
- if tf.rank(b) == tf.rank(a) - 1:
+ if b.shape.ndims == a.shape.ndims - 1:
173
b = tf.expand_dims(b, axis=-1)
174
return tf.squeeze(tf.linalg.solve(a, b), axis=-1)
175
return tf.linalg.solve(a, b)
0 commit comments