Skip to content

Commit

Permalink
Fix gather_op and gather_nd_op by rectifying use of 0UL, test=develop (
Browse files Browse the repository at this point in the history
  • Loading branch information
haohongxiang authored Jul 14, 2021
1 parent 6febe5f commit b724703
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions paddle/fluid/operators/gather.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void CPUGather(const platform::DeviceContext& ctx, const Tensor& src,
"input dim size of axis which is %d, but received "
"index element which is %d in the %d index.",
input_size, p_index[i], i));
PADDLE_ENFORCE_GE(p_index[i], 0UL,
PADDLE_ENFORCE_GE(p_index[i], 0,
platform::errors::OutOfRange(
"The element of Index must be greater than or equal "
"to 0, but received index element which is %d in the "
Expand Down Expand Up @@ -128,7 +128,7 @@ void CPUGatherNd(const platform::DeviceContext& ctx, const Tensor& input,
platform::errors::InvalidArgument(
"Input(index[-1)] has wrong value, it is [%d]", index_value));
PADDLE_ENFORCE_GE(
index_value, 0UL,
index_value, 0,
platform::errors::InvalidArgument(
"The value of Input(index) must be no less than 0"));

Expand Down Expand Up @@ -160,7 +160,7 @@ void GatherV2Function(const Tensor* input, const Tensor* index, int axis,
"input dim size of axis which is %d, but received "
"index element which is %d in the %d index.",
input_index_dim_size, index_data[i], i));
PADDLE_ENFORCE_GE(index_data[i], 0UL,
PADDLE_ENFORCE_GE(index_data[i], 0,
platform::errors::OutOfRange(
"The element of Index must be greater than or equal "
"to 0, but received index element which is %d in the "
Expand Down

0 comments on commit b724703

Please sign in to comment.