From b724703b8dfc933538561b2a522bc2f1fe3eb942 Mon Sep 17 00:00:00 2001 From: Haohongxiang <86215757+haohongxiang@users.noreply.github.com> Date: Tue, 13 Jul 2021 22:02:10 -0500 Subject: [PATCH] Fix gather_op and gather_nd_op by rectifying use of 0UL, test=develop (#34138) --- paddle/fluid/operators/gather.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/operators/gather.h b/paddle/fluid/operators/gather.h index b7fa4022882..43dc8240633 100644 --- a/paddle/fluid/operators/gather.h +++ b/paddle/fluid/operators/gather.h @@ -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 " @@ -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")); @@ -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 " -- GitLab