提交 f5517de7 编写于 作者: A Abhinav Arora

Fix warnings in priorbox, sequence_reshape and ctc_align_op

上级 a173fa75
...@@ -69,7 +69,7 @@ bool PriorBoxLayer::init(const LayerMap& layerMap, ...@@ -69,7 +69,7 @@ bool PriorBoxLayer::init(const LayerMap& layerMap,
if (maxSize_.size() > 0) CHECK_EQ(minSize_.size(), maxSize_.size()); if (maxSize_.size() > 0) CHECK_EQ(minSize_.size(), maxSize_.size());
// flip aspect ratios // flip aspect ratios
for (int index = 0; index < tmp.size(); index++) { for (unsigned index = 0; index < tmp.size(); index++) {
real ar = tmp[index]; real ar = tmp[index];
if (fabs(ar - 1.) < 1e-6) continue; if (fabs(ar - 1.) < 1e-6) continue;
aspectRatio_.push_back(ar); aspectRatio_.push_back(ar);
......
...@@ -51,7 +51,7 @@ class CTCAlignKernel : public framework::OpKernel<T> { ...@@ -51,7 +51,7 @@ class CTCAlignKernel : public framework::OpKernel<T> {
T prev_token = -1; T prev_token = -1;
for (size_t i = input_lod[level][seq_idx]; for (size_t i = input_lod[level][seq_idx];
i < input_lod[level][seq_idx + 1]; ++i) { i < input_lod[level][seq_idx + 1]; ++i) {
if (input_data[i] != blank && if ((unsigned)input_data[i] != blank &&
!(merge_repeated && input_data[i] == prev_token)) { !(merge_repeated && input_data[i] == prev_token)) {
output_data[output_idx] = input_data[i]; output_data[output_idx] = input_data[i];
++output_idx; ++output_idx;
......
...@@ -35,7 +35,7 @@ class SequenceReshapeKernel : public framework::OpKernel<T> { ...@@ -35,7 +35,7 @@ class SequenceReshapeKernel : public framework::OpKernel<T> {
PADDLE_ENFORCE_EQ(in_lod.size(), 1UL, PADDLE_ENFORCE_EQ(in_lod.size(), 1UL,
"Only support one level sequence now."); "Only support one level sequence now.");
PADDLE_ENFORCE_EQ( PADDLE_ENFORCE_EQ(
in_dims[0], in_lod[0].back(), (uint64_t)in_dims[0], in_lod[0].back(),
"Inconsistent size between X.shape[0] and X.lod()[0].back()."); "Inconsistent size between X.shape[0] and X.lod()[0].back().");
auto in_lod_l0 = in_lod[0]; auto in_lod_l0 = in_lod[0];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册