Skip to content

Commit 51d576a

Browse files
committed
Restore GT check in reduce_function.
1 parent 8f177f8 commit 51d576a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

paddle/phi/kernels/funcs/reduce_function.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -1357,11 +1357,10 @@ void ReduceKernelImpl(const Context& dev_ctx,
13571357
const std::vector<int64_t>& dims,
13581358
bool keep_dim,
13591359
bool reduce_all) {
1360-
PADDLE_ENFORCE_GE(input.numel(),
1360+
PADDLE_ENFORCE_GT(x.numel(),
13611361
0,
13621362
common::errors::InvalidArgument(
1363-
"The input size (numel) of reduce op should be larger "
1364-
"than or equal to 0"));
1363+
"Tensor need be reduced must not empty."));
13651364

13661365
dev_ctx.template Alloc<OutT>(output);
13671366

0 commit comments

Comments
 (0)