Skip to content

Commit 78ca6a4

Browse files
authored
Add support for dynamic dimensions for ops handling tf.IndexedSlices. (#21148)
Fixes #21069
1 parent ea84f00 commit 78ca6a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

keras/src/backend/tensorflow/sparse.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def values_for_union(indices_expanded, indices_count, values):
131131
)
132132
to_union_indices = tf.gather(indices_indices, union_indices)
133133
values_with_leading_zeros = tf.concat(
134-
[tf.zeros((1,) + values.shape[1:], values.dtype), values], axis=0
134+
[tf.zeros_like(values[0:1]), values], axis=0
135135
)
136136
return tf.gather(values_with_leading_zeros, to_union_indices)
137137

0 commit comments

Comments
 (0)