From 1c0653462db5bb5c359a8b067d9b1624b5d63280 Mon Sep 17 00:00:00 2001 From: dyning Date: Tue, 25 Feb 2020 12:17:25 +0800 Subject: [PATCH] fix generate_mask_labels lod level (#22743) --- paddle/fluid/operators/detection/generate_mask_labels_op.cc | 5 +++++ .../unittests/white_list/compile_vs_runtime_white_list.py | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/paddle/fluid/operators/detection/generate_mask_labels_op.cc b/paddle/fluid/operators/detection/generate_mask_labels_op.cc index 16753c42945..b2e9e705fa9 100644 --- a/paddle/fluid/operators/detection/generate_mask_labels_op.cc +++ b/paddle/fluid/operators/detection/generate_mask_labels_op.cc @@ -75,6 +75,11 @@ class GenerateMaskLabelsOp : public framework::OperatorWithKernel { ctx->SetOutputDim("MaskRois", {-1, 4}); ctx->SetOutputDim("RoiHasMaskInt32", {-1, 1}); ctx->SetOutputDim("MaskInt32", {-1, num_classes * resolution * resolution}); + if (!ctx->IsRuntime()) { + ctx->SetLoDLevel("MaskRois", ctx->GetLoDLevel("Rois")); + ctx->SetLoDLevel("RoiHasMaskInt32", ctx->GetLoDLevel("Rois")); + ctx->SetLoDLevel("MaskInt32", ctx->GetLoDLevel("Rois")); + } } protected: 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 da906f2c0e7..39db9f5476b 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 @@ -21,7 +21,6 @@ COMPILE_RUN_OP_WHITE_LIST = [ 'sequence_pool', \ 'sequence_slice', \ - 'generate_mask_labels', \ 'generate_proposals', \ 'mine_hard_examples', \ 'retinanet_detection_output', \ -- GitLab