From e44dedf90f6b0563d6a36f58f10448e29d2ac552 Mon Sep 17 00:00:00 2001 From: dangqingqing Date: Mon, 22 Jan 2018 23:54:25 +0800 Subject: [PATCH] Fix the warning and unit test. --- paddle/operators/bipartite_match_op.cc | 2 +- python/paddle/v2/fluid/tests/test_bipartite_match_op.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/operators/bipartite_match_op.cc b/paddle/operators/bipartite_match_op.cc index 0fcff6e26d7..b0f7376d272 100644 --- a/paddle/operators/bipartite_match_op.cc +++ b/paddle/operators/bipartite_match_op.cc @@ -62,7 +62,7 @@ class BipartiteMatchKernel : public framework::OpKernel { if (match_indices[j] != -1) { continue; } - for (int k = 0; k < row_pool.size(); ++k) { + for (size_t k = 0; k < row_pool.size(); ++k) { int m = row_pool[k]; // distance is 0 between m-th row and j-th column if (dist_data[m * col + j] < kEPS) { diff --git a/python/paddle/v2/fluid/tests/test_bipartite_match_op.py b/python/paddle/v2/fluid/tests/test_bipartite_match_op.py index 8f1db35d3c5..34101b1da46 100644 --- a/python/paddle/v2/fluid/tests/test_bipartite_match_op.py +++ b/python/paddle/v2/fluid/tests/test_bipartite_match_op.py @@ -69,7 +69,7 @@ class TestBipartiteMatchOpForWithLoD(OpTest): dis = np.random.random((23, 217)).astype('float32') match_indices, match_dis = batch_bipartite_match(dis, lod[0]) - self.inputs = {'DisMat': (dis, lod)} + self.inputs = {'DistMat': (dis, lod)} self.outputs = { 'ColToRowMatchIndices': (match_indices), 'ColToRowMatchDis': (match_dis), @@ -86,7 +86,7 @@ class TestBipartiteMatchOpWithoutLoD(OpTest): dis = np.random.random((8, 17)).astype('float32') match_indices, match_dis = batch_bipartite_match(dis, lod[0]) - self.inputs = {'DisMat': dis} + self.inputs = {'DistMat': dis} self.outputs = { 'ColToRowMatchIndices': (match_indices), 'ColToRowMatchDis': (match_dis), -- GitLab