diff --git a/paddle/fluid/operators/interpolate_op.cc b/paddle/fluid/operators/interpolate_op.cc index 056b81fd9a2ef7b3efb127c5e06e34ed18ba34ff..ac50da83e6b782c9d926dc36fcfb48ae675f32c0 100644 --- a/paddle/fluid/operators/interpolate_op.cc +++ b/paddle/fluid/operators/interpolate_op.cc @@ -342,10 +342,11 @@ class InterpolateOp : public framework::OperatorWithKernel { auto data_type = OperatorWithKernel::IndicateVarDataType(ctx, "X"); #ifdef PADDLE_WITH_MKLDNN - const auto& interp_method = ctx.Attr("interp_method"); // TODO(danqing): support other interp_method - if (this->CanMKLDNNBeUsed(ctx, data_type) && - (interp_method == "nearest" || interp_method == "bilinear")) { + // (https://github.com/PaddlePaddle/Paddle/pull/30016/files) + // NOTE(jiahy0825): currently only support interp_method = nearest or + // interp_method = bilinear + if (this->CanMKLDNNBeUsed(ctx, data_type)) { return framework::OpKernelType(data_type, ctx.GetPlace(), framework::DataLayout::kMKLDNN, diff --git a/paddle/fluid/operators/interpolate_v2_op.cc b/paddle/fluid/operators/interpolate_v2_op.cc index e7a362f543b762fd1cd4a5d8312ea798d51a59be..e9d0d718b9fb792d74bb127335c90f98f85b5ef4 100644 --- a/paddle/fluid/operators/interpolate_v2_op.cc +++ b/paddle/fluid/operators/interpolate_v2_op.cc @@ -446,10 +446,11 @@ class InterpolateV2Op : public framework::OperatorWithKernel { auto data_type = OperatorWithKernel::IndicateVarDataType(ctx, "X"); #ifdef PADDLE_WITH_MKLDNN - const auto& interp_method = ctx.Attr("interp_method"); // TODO(danqing): support other interp_method - if (this->CanMKLDNNBeUsed(ctx, data_type) && - (interp_method == "nearest" || interp_method == "bilinear")) { + // (https://github.com/PaddlePaddle/Paddle/pull/30016/files) + // NOTE(jiahy0825): currently only support interp_method = nearest or + // interp_method = bilinear + if (this->CanMKLDNNBeUsed(ctx, data_type)) { return framework::OpKernelType(data_type, ctx.GetPlace(), framework::DataLayout::kMKLDNN,