Skip to content

Commit

Permalink
fix rank=1 (#51413)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxn12138 authored Mar 14, 2023
1 parent b642461 commit b4f49aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion paddle/phi/infermeta/ternary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ void ScatterNdAddInferMeta(const MetaTensor& x,
index_dims[index_dims_size - 1],
ref_dims_size));
PADDLE_ENFORCE_GE(index_dims_size,
2UL,
1UL,
phi::errors::InvalidArgument(
"The rank of Input(Index) should be greater than 1, "
"but received the rank of Input(Index) is %d.",
Expand Down
2 changes: 1 addition & 1 deletion python/paddle/fluid/tests/unittests/test_gather_nd_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_check_output(self):
self.check_output(check_eager=False)

def test_check_grad(self):
self.check_grad(['X'], 'Out', check_eager=False)
self.check_grad(['X'], 'Out', check_eager=False, check_prim=True)


class TestGatherNdOpWithLowIndex(OpTest):
Expand Down

0 comments on commit b4f49aa

Please sign in to comment.