Skip to content

Commit c0d63c1

Browse files
authored
[Warning fix] fix warning for slice_utils.h (#74474)
1 parent b8496da commit c0d63c1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

paddle/fluid/pybind/slice_utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ static void ParseIndex(const paddle::Tensor& tensor,
525525
if (slice_tensor.dtype() == phi::DataType::BOOL) {
526526
// bool tensor consumes (rank of index tensor) dimensions of input
527527
// tensor
528-
for (int i = 0; i < slice_tensor.shape().size(); i++) {
528+
for (size_t i = 0; i < slice_tensor.shape().size(); i++) {
529529
PADDLE_ENFORCE_EQ(slice_tensor.shape()[i],
530530
dim_len,
531531
common::errors::OutOfRange(
@@ -684,7 +684,7 @@ static paddle::Tensor dealWithAdvancedIndex(
684684
if (index.dtype() == phi::DataType::BOOL) {
685685
*rank_of_new_dim = std::max(*rank_of_new_dim, 1);
686686
i--;
687-
for (int j = 0; j < index.shape().size(); j++) {
687+
for (size_t j = 0; j < index.shape().size(); j++) {
688688
i++;
689689
index_dim = (*advanced_index_dim)[i];
690690
trans_dim->push_back(index_dim);

0 commit comments

Comments
 (0)