diff --git a/paddle/fluid/operators/detection/box_coder_op.cc b/paddle/fluid/operators/detection/box_coder_op.cc index e3424174915b20aa7a1443b6f3781d99858d5f15..b4b02124ccd206cd604dcbea063bfe896eb3fd28 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"); + } + } } };