diff --git a/paddle/operators/bipartite_match_op.cc b/paddle/operators/bipartite_match_op.cc index 0fcff6e26d7e9a84ee326267181e849d9eac3e9c..b0f7376d272a66e0b01d6b3f7e546372397772f7 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 8f1db35d3c5b2bfcc590478a14a20efeb7f7180b..34101b1da46d46d0e7a995ba80d8644dc586065d 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),