提交 e5e7628a 编写于 作者: D Dang Qingqing

Skip compile infer shape in box_coder_op

test=develop
上级 0ca6465a
...@@ -60,14 +60,15 @@ class BoxCoderOp : public framework::OperatorWithKernel { ...@@ -60,14 +60,15 @@ class BoxCoderOp : public framework::OperatorWithKernel {
} else if (code_type == BoxCodeType::kDecodeCenterSize) { } else if (code_type == BoxCodeType::kDecodeCenterSize) {
PADDLE_ENFORCE_EQ(target_box_dims.size(), 3, PADDLE_ENFORCE_EQ(target_box_dims.size(), 3,
"The rank of Input TargetBox must be 3"); "The rank of Input TargetBox must be 3");
if (axis == 0) { PADDLE_ENFORCE(axis == 0 || axis == 1, "axis must be 0 or 1");
PADDLE_ENFORCE_EQ(target_box_dims[1], prior_box_dims[0]); if (ctx->IsRuntime()) {
} else if (axis == 1) { if (axis == 0) {
PADDLE_ENFORCE_EQ(target_box_dims[0], prior_box_dims[0]); PADDLE_ENFORCE_EQ(target_box_dims[1], prior_box_dims[0]);
} else { } else if (axis == 1) {
PADDLE_THROW("axis must be 0 or 1."); PADDLE_ENFORCE_EQ(target_box_dims[0], prior_box_dims[0]);
}
PADDLE_ENFORCE_EQ(target_box_dims[2], prior_box_dims[1]);
} }
PADDLE_ENFORCE_EQ(target_box_dims[2], prior_box_dims[1]);
ctx->ShareDim("TargetBox", /*->*/ "OutputBox"); ctx->ShareDim("TargetBox", /*->*/ "OutputBox");
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册