Skip to content

Commit 6abe7dc

Browse files
authored
support bool index for int tensor (#37761)
1 parent b0d580a commit 6abe7dc

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

python/paddle/fluid/variable_index.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -674,14 +674,6 @@ def _setitem_impl_(var, item, value):
674674

675675
# the item is a tensor of bool
676676
def set_value_for_bool_tensor(var, item, value):
677-
678-
# TODO(zyfncg): Now scatter_nd_add only support float32 and float64 tensor,
679-
# so in the current version we also only support float32 and float64 tensor,
680-
# this problem will be fixed in the future.
681-
if var.dtype != core.VarDesc.VarType.FP32 and var.dtype != core.VarDesc.VarType.FP64:
682-
raise TypeError("Only support float and double tensor for bool index, "
683-
"but received {}.".format(var.dtype))
684-
685677
if len(item.shape) > len(var.shape):
686678
raise IndexError("The dims of bool index doesn't match indexed array, "
687679
"the dims of bool index except to be equal or less "

0 commit comments

Comments
 (0)