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 3c10960 commit e2fdb08Copy full SHA for e2fdb08
paddle/fluid/framework/operator.cc
@@ -1065,8 +1065,9 @@ bool OperatorWithKernel::SupportsMKLDNN(
1065
1066
bool OperatorWithKernel::CanMKLDNNBeUsed(const framework::ExecutionContext& ctx,
1067
proto::VarType::Type data_type) const {
1068
- bool use_mkldnn_ctx =
1069
- ctx.Attr<bool>("use_mkldnn") && platform::is_cpu_place(ctx.GetPlace());
+ bool use_mkldnn_ctx = ctx.HasAttr("use_mkldnn") &&
+ ctx.Attr<bool>("use_mkldnn") &&
1070
+ platform::is_cpu_place(ctx.GetPlace());
1071
return use_mkldnn_ctx && this->SupportsMKLDNN(data_type);
1072
}
1073
0 commit comments