未验证 提交 0fb6bca4 编写于 作者: W Wei Shengyu 提交者: GitHub

fix infer shapes of pool_with_index (#40139)

* dbg pool infer shapes

* dbg

* fix format
上级 55a3bfbd
......@@ -81,8 +81,12 @@ class MaxPoolWithIndexOp : public framework::OperatorWithKernel {
output_shape.insert(output_shape.end(), ksize.begin(), ksize.end());
} else {
for (size_t i = 0; i < ksize.size(); ++i) {
output_shape.push_back(MaxPoolOutputSize(in_x_dims[i + 2], ksize[i],
paddings[i], strides[i]));
if ((!ctx->IsRuntime()) && (in_x_dims[i + 2] < 0)) {
output_shape.push_back(in_x_dims[i + 2]);
} else {
output_shape.push_back(MaxPoolOutputSize(in_x_dims[i + 2], ksize[i],
paddings[i], strides[i]));
}
}
}
ctx->SetOutputDim("Out", phi::make_ddim(output_shape));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册