Skip to content

Commit

Permalink
fix interpolate mkldnn op error (#36623)
Browse files Browse the repository at this point in the history
  • Loading branch information
baoachun authored Oct 23, 2021
1 parent 425db7c commit f6d8252
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions paddle/fluid/operators/mkldnn/interpolate_mkldnn_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f6d8252

Please sign in to comment.