Skip to content

Commit

Permalink
support bool index for int tensor
Browse files Browse the repository at this point in the history
  • Loading branch information
zyfncg committed Dec 1, 2021
1 parent 3d2ec70 commit d20a99f
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions python/paddle/fluid/variable_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,14 +674,6 @@ def _setitem_impl_(var, item, value):

# the item is a tensor of bool
def set_value_for_bool_tensor(var, item, value):

# TODO(zyfncg): Now scatter_nd_add only support float32 and float64 tensor,
# so in the current version we also only support float32 and float64 tensor,
# this problem will be fixed in the future.
if var.dtype != core.VarDesc.VarType.FP32 and var.dtype != core.VarDesc.VarType.FP64:
raise TypeError("Only support float and double tensor for bool index, "
"but received {}.".format(var.dtype))

if len(item.shape) > len(var.shape):
raise IndexError("The dims of bool index doesn't match indexed array, "
"the dims of bool index except to be equal or less "
Expand Down

1 comment on commit d20a99f

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.