We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3a81805 commit 14fd53dCopy full SHA for 14fd53d
paddle/fluid/framework/operator.cc
@@ -1066,8 +1066,9 @@ bool OperatorWithKernel::SupportsMKLDNN(
1066
1067
bool OperatorWithKernel::CanMKLDNNBeUsed(const framework::ExecutionContext& ctx,
1068
proto::VarType::Type data_type) const {
1069
- bool use_mkldnn_ctx =
1070
- ctx.Attr<bool>("use_mkldnn") && platform::is_cpu_place(ctx.GetPlace());
+ bool use_mkldnn_ctx = ctx.HasAttr("use_mkldnn") &&
+ ctx.Attr<bool>("use_mkldnn") &&
1071
+ platform::is_cpu_place(ctx.GetPlace());
1072
return use_mkldnn_ctx && this->SupportsMKLDNN(data_type);
1073
}
1074
0 commit comments