Skip to content

Commit 92a2817

Browse files
committed
test=develop
2 parents a9d7a9d + 6b4056b commit 92a2817

34 files changed

+389
-344
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/op_desc.cc

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -515,20 +515,14 @@ void OpDesc::InferShape(const BlockDesc &block) const {
515515
}
516516

517517
void OpDesc::InferVarType(BlockDesc *block) const {
518+
// There are a few places that var type can be set.
519+
// When VarDesc is created, default set to LOD_TENSOR.
520+
// When output variable is created, default is defaut set to LOD_TENSOR.
521+
// We limit here to be the only place that operator defines its customized
522+
// var type inference. Hence, we don't do any "default" setting here.
518523
auto &info = OpInfoMap::Instance().Get(this->Type());
519524
if (info.infer_var_type_) {
520525
info.infer_var_type_(*this, block);
521-
} else {
522-
// all output type is LoDTensor by default
523-
VLOG(10) << this->Type()
524-
<< " has not registered InferVarType. Set output variables to "
525-
"LOD_TENSOR";
526-
for (auto &out_pair : this->outputs_) {
527-
for (auto &out_var_name : out_pair.second) {
528-
block->FindRecursiveOrCreateVar(out_var_name)
529-
.SetType(proto::VarType::LOD_TENSOR);
530-
}
531-
}
532526
}
533527
}
534528

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/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,10 @@ op_library(max_sequence_len_op DEPS lod_rank_table)
284284
op_library(sequence_conv_op DEPS context_project)
285285
op_library(sequence_pool_op DEPS sequence_pooling)
286286
if (NOT WIN32)
287-
op_library(lstm_op DEPS sequence2batch lstm_compute)
288-
op_library(hierarchical_sigmoid_op DEPS matrix_bit_code)
289-
op_library(lstmp_op DEPS sequence2batch lstm_compute)
290-
op_library(gru_op DEPS sequence2batch gru_compute)
287+
op_library(lstm_op DEPS sequence2batch lstm_compute)
288+
op_library(hierarchical_sigmoid_op DEPS matrix_bit_code)
289+
op_library(lstmp_op DEPS sequence2batch lstm_compute)
290+
op_library(gru_op DEPS sequence2batch gru_compute)
291291
endif(NOT WIN32)
292292
op_library(recurrent_op DEPS executor)
293293
op_library(warpctc_op DEPS dynload_warpctc sequence_padding sequence_scale)
@@ -316,7 +316,7 @@ op_library(save_op DEPS lod_tensor)
316316
op_library(load_op DEPS lod_tensor)
317317
op_library(save_combine_op DEPS lod_tensor)
318318
op_library(load_combine_op DEPS lod_tensor)
319-
op_library(concat_op DEPS concat)
319+
op_library(concat_op DEPS concat_and_split)
320320

321321
list(REMOVE_ITEM GENERAL_OPS ${DEPS_OPS})
322322

@@ -348,6 +348,6 @@ cc_test(strided_memcpy_test SRCS strided_memcpy_test.cc DEPS tensor memory)
348348
cc_test(save_load_op_test SRCS save_load_op_test.cc DEPS save_op load_op)
349349
cc_test(save_load_combine_op_test SRCS save_load_combine_op_test.cc DEPS save_combine_op load_combine_op)
350350
if(NOT WIN32)
351-
nv_test(nccl_op_test SRCS nccl_op_test.cu.cc DEPS nccl_op gpu_info device_context)
351+
nv_test(nccl_op_test SRCS nccl_op_test.cu.cc DEPS nccl_op gpu_info device_context)
352352
endif()
353353
nv_test(dropout_op_test SRCS dropout_op_test.cc DEPS dropout_op tensor)

paddle/fluid/operators/array_to_lod_tensor_op.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ distributed under the License is distributed on an "AS IS" BASIS,
1111
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License. */
14-
#include <paddle/fluid/operators/math/concat.h>
14+
#include <paddle/fluid/operators/math/concat_and_split.h>
1515
#include <numeric>
1616

1717
#include "paddle/fluid/framework/lod_rank_table.h"

0 commit comments

Comments
 (0)