Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gather_op and gather_nd_op by rectifying use of 0UL, test=develop #34138

Merged
merged 1 commit into from
Jul 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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