Skip to content

Commit 23da8de

Browse files
authored
Merge pull request #14028 from luotao1/fix_resnet50_test
fix typo and warning in analyzer_resnet50_test
2 parents a749765 + 316bc9b commit 23da8de

File tree

8 files changed

+10
-12
lines changed

8 files changed

+10
-12
lines changed

paddle/fluid/framework/ir/CMakeLists.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,10 @@ if(WITH_MKLDNN)
4242
pass_library(mkldnn_placement_pass base)
4343
pass_library(conv_bias_mkldnn_fuse_pass inference)
4444
pass_library(conv_relu_mkldnn_fuse_pass inference)
45+
pass_library(conv_elementwise_add_mkldnn_fuse_pass inference)
4546
endif()
4647

4748
cc_library(fuse_elewise_add_act_pass SRCS fuse_elewise_add_act_pass.cc DEPS pass graph_pattern_detector )
48-
if(WITH_MKLDNN)
49-
pass_library(conv_elementwise_add_mkldnn_fuse_pass inference)
50-
endif()
5149

5250
set(GLOB_PASS_LIB ${PASS_LIBRARY} CACHE INTERNAL "Global PASS library")
5351

paddle/fluid/framework/ir/graph_helper_test.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,15 @@ TEST(GraphHelperTest, GraphNum) {
200200

201201
Graph g(prog);
202202
BuildZeroGraph(&g);
203-
ASSERT_EQ(GraphNum(g), 0);
203+
ASSERT_EQ(GraphNum(g), 0UL);
204204

205205
Graph g2(prog);
206206
BuildOneGraph(&g2);
207-
ASSERT_EQ(GraphNum(g2), 1);
207+
ASSERT_EQ(GraphNum(g2), 1UL);
208208

209209
Graph g3(prog);
210210
BuildTwoGraphs(&g3);
211-
ASSERT_EQ(GraphNum(g3), 2);
211+
ASSERT_EQ(GraphNum(g3), 2UL);
212212
}
213213

214214
} // namespace ir

paddle/fluid/framework/ir/graph_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ TEST(GraphTest, Basic) {
124124
ASSERT_EQ(n->outputs.size(), 0UL);
125125
}
126126
}
127-
ASSERT_EQ(nodes.size(), 5);
127+
ASSERT_EQ(nodes.size(), 5UL);
128128
}
129129

130130
TEST(GraphTest, WriteAfterRead) {

paddle/fluid/framework/program_desc_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ TEST(ProgramDesc, copy_ctor) {
103103
ASSERT_EQ(1, op->GetBlockAttrId("sub_block"));
104104
found_sub_block = true;
105105

106-
ASSERT_EQ(2, op->GetBlocksAttrIds("sub_blocks").size());
106+
ASSERT_EQ(2UL, op->GetBlocksAttrIds("sub_blocks").size());
107107
found_sub_blocks = true;
108108
}
109109
}

paddle/fluid/framework/reader_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ TEST(READER, decorate_chain) {
4040
auto endpoints = root->GetEndPoints();
4141
ASSERT_EQ(endpoints.size(), 2U);
4242
ASSERT_NE(endpoints.count(end_point1.get()), 0UL);
43-
ASSERT_NE(endpoints.count(end_point2.get()), 0);
43+
ASSERT_NE(endpoints.count(end_point2.get()), 0UL);
4444
}
4545

4646
{

paddle/fluid/inference/tests/api/analyzer_resnet50_tester.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void profile(bool use_mkldnn = false) {
7171
}
7272

7373
TEST(Analyzer_resnet50, profile) { profile(); }
74-
#ifndef PADDLE_WITH_MKLDNN
74+
#ifdef PADDLE_WITH_MKLDNN
7575
TEST(Analyzer_resnet50, profile_mkldnn) { profile(true /* use_mkldnn */); }
7676
#endif
7777

paddle/fluid/inference/tests/api/tester_helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void CompareResult(const std::vector<PaddleTensor> &outputs,
5050
auto &ref_out = ref_outputs[i];
5151
size_t size = VecReduceToInt(out.shape);
5252
size_t ref_size = VecReduceToInt(ref_out.shape);
53-
EXPECT_GT(size, 0);
53+
EXPECT_GT(size, 0UL);
5454
EXPECT_EQ(size, ref_size);
5555
EXPECT_EQ(out.dtype, ref_out.dtype);
5656
switch (out.dtype) {

paddle/fluid/operators/reader/reader_blocking_queue_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ TEST(BlockingQueue, speed_test_mode) {
237237
}
238238
for (size_t i = 0; i < queue_size; ++i) {
239239
q2.Receive(&b);
240-
EXPECT_EQ(b, 0);
240+
EXPECT_EQ(b, 0UL);
241241
}
242242
EXPECT_EQ(q2.Size(), queue_size);
243243
}

0 commit comments

Comments
 (0)