Skip to content

Commit 95853fc

Browse files
authored
Merge pull request #7806 from abhinavarora/fix_warnings
Fix warnings in priorbox, sequence_reshape and ctc_align_op
2 parents de797ad + f5517de commit 95853fc

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

paddle/gserver/layers/PriorBox.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ bool PriorBoxLayer::init(const LayerMap& layerMap,
6969
if (maxSize_.size() > 0) CHECK_EQ(minSize_.size(), maxSize_.size());
7070

7171
// flip aspect ratios
72-
for (int index = 0; index < tmp.size(); index++) {
72+
for (unsigned index = 0; index < tmp.size(); index++) {
7373
real ar = tmp[index];
7474
if (fabs(ar - 1.) < 1e-6) continue;
7575
aspectRatio_.push_back(ar);

paddle/operators/ctc_align_op.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class CTCAlignKernel : public framework::OpKernel<T> {
5151
T prev_token = -1;
5252
for (size_t i = input_lod[level][seq_idx];
5353
i < input_lod[level][seq_idx + 1]; ++i) {
54-
if (input_data[i] != blank &&
54+
if ((unsigned)input_data[i] != blank &&
5555
!(merge_repeated && input_data[i] == prev_token)) {
5656
output_data[output_idx] = input_data[i];
5757
++output_idx;

paddle/operators/sequence_reshape_op.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SequenceReshapeKernel : public framework::OpKernel<T> {
3535
PADDLE_ENFORCE_EQ(in_lod.size(), 1UL,
3636
"Only support one level sequence now.");
3737
PADDLE_ENFORCE_EQ(
38-
in_dims[0], in_lod[0].back(),
38+
(uint64_t)in_dims[0], in_lod[0].back(),
3939
"Inconsistent size between X.shape[0] and X.lod()[0].back().");
4040

4141
auto in_lod_l0 = in_lod[0];

0 commit comments

Comments
 (0)