未验证 提交 f6d82526 编写于 作者: B baoachun 提交者: GitHub

fix interpolate mkldnn op error (#36623)

上级 425db7c8
......@@ -104,8 +104,10 @@ class InterpolateMKLDNNKernel : public framework::OpKernel<T> {
scale.push_back(scale[0]);
} else { // v2
std::vector<float> scale_attr = ctx.Attr<std::vector<float>>("scale");
scale.resize(3, scale_attr[0]);
std::copy(scale_attr.begin(), scale_attr.end(), scale.begin());
if (scale_attr.size() > 0) {
scale.resize(3, scale_attr[0]);
std::copy(scale_attr.begin(), scale_attr.end(), scale.begin());
}
}
}
if (scale[0] > 0.0f && scale[1] > 0.0f && scale[2] > 0.0f) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册