From 0d915078597f483057b25cdc2e99bdd9bee71f71 Mon Sep 17 00:00:00 2001 From: jerrywgz Date: Mon, 21 Jan 2019 05:22:47 +0000 Subject: [PATCH] fix share lod, test=develop --- paddle/fluid/operators/detection/box_coder_op.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/detection/box_coder_op.cc b/paddle/fluid/operators/detection/box_coder_op.cc index e3424174915..b4b02124ccd 100644 --- a/paddle/fluid/operators/detection/box_coder_op.cc +++ b/paddle/fluid/operators/detection/box_coder_op.cc @@ -77,9 +77,13 @@ class BoxCoderOp : public framework::OperatorWithKernel { PADDLE_ENFORCE_EQ(target_box_dims[2], prior_box_dims[1]); ctx->ShareDim("TargetBox", /*->*/ "OutputBox"); } - } - ctx->ShareLoD("TargetBox", /*->*/ "OutputBox"); + if (code_type == BoxCodeType::kDecodeCenterSize && axis == 1) { + ctx->ShareLoD("PriorBox", /*->*/ "OutputBox"); + } else { + ctx->ShareLoD("TargetBox", /*->*/ "OutputBox"); + } + } } }; -- GitLab