From 870f465887fc95e1031aaaf8adf4b3864f7c12b4 Mon Sep 17 00:00:00 2001 From: Wilber Date: Mon, 10 Feb 2020 12:09:15 +0800 Subject: [PATCH] fix test_fusion_seqpool_concat lod level between compile and runtime (#22488) --- paddle/fluid/operators/fused/fusion_seqpool_concat_op.cc | 6 ++++++ .../unittests/white_list/compile_vs_runtime_white_list.py | 7 +++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/operators/fused/fusion_seqpool_concat_op.cc b/paddle/fluid/operators/fused/fusion_seqpool_concat_op.cc index 7ca02a2541d..c260b28354e 100644 --- a/paddle/fluid/operators/fused/fusion_seqpool_concat_op.cc +++ b/paddle/fluid/operators/fused/fusion_seqpool_concat_op.cc @@ -42,6 +42,12 @@ void FusionSeqPoolConcatOp::InferShape( PADDLE_ENFORCE_EQ(ins_dims[0].size(), 2, "The dims size of first input should be 2."); ctx->SetOutputDim("Out", {-1, ins_dims[0][axis] * static_cast(n)}); + + if (!ctx->IsRuntime()) { + // when compiling, the LodLevel of Out is set to be 1, which is consistent + // with that in running time. + ctx->SetLoDLevel("Out", 1); + } } framework::OpKernelType FusionSeqPoolConcatOp::GetExpectedKernelType( diff --git a/python/paddle/fluid/tests/unittests/white_list/compile_vs_runtime_white_list.py b/python/paddle/fluid/tests/unittests/white_list/compile_vs_runtime_white_list.py index 1958e90ad12..9aabfb40827 100644 --- a/python/paddle/fluid/tests/unittests/white_list/compile_vs_runtime_white_list.py +++ b/python/paddle/fluid/tests/unittests/white_list/compile_vs_runtime_white_list.py @@ -23,8 +23,7 @@ COMPILE_RUN_OP_WHITE_LIST = [ 'sequence_reshape', 'generate_proposals', 'mine_hard_examples', 'retinanet_detection_output', 'ctc_align', 'fusion_seqpool_cvm_concat', 'gru', 'sequence_erase', 'rpn_target_assign', 'retinanet_target_assign', - 'filter_by_instag', 'fusion_seqpool_concat', 'multiclass_nms', - 'multiclass_nms2', 'im2sequence', 'generate_proposal_labels', - 'distribute_fpn_proposals', 'detection_map', 'locality_aware_nms', - 'var_conv_2d' + 'filter_by_instag', 'multiclass_nms', 'multiclass_nms2', 'im2sequence', + 'generate_proposal_labels', 'distribute_fpn_proposals', 'detection_map', + 'locality_aware_nms', 'var_conv_2d' ] -- GitLab