Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions paddle/fluid/ir_adaptor/translator/op_translator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,10 @@ struct CastOpTranscriber : public OpTranscriber {
attribute_map["mkldnn_data_type"] = pir::StrAttribute::get(
ctx, op_desc.GetAttrIfExists<std::string>("mkldnn_data_type"));
}
if (op_desc.HasAttr("onednn_data_type")) { // NOLINT
attribute_map["onednn_data_type"] = pir::StrAttribute::get(
ctx, op_desc.GetAttrIfExists<std::string>("onednn_data_type"));
}
#endif
return attribute_map;
}
Expand Down Expand Up @@ -1661,12 +1665,16 @@ struct SplitOpTranscriber : public OpTranscriber {
return attribute_map;
}
#ifdef PADDLE_WITH_DNNL
else if (op_desc.HasAttr("mkldnn_data_type")) { // NOLINT
pir::AttributeMap attribute_map = {
{"mkldnn_data_type",
pir::StrAttribute::get(
ctx, op_desc.GetAttrIfExists<std::string>("mkldnn_data_type"))},
};
else { // NOLINT
pir::AttributeMap attribute_map = {};
if (op_desc.HasAttr("mkldnn_data_type")) {
attribute_map["mkldnn_data_type"] = pir::StrAttribute::get(
ctx, op_desc.GetAttrIfExists<std::string>("mkldnn_data_type"));
}
if (op_desc.HasAttr("onednn_data_type")) {
attribute_map["onednn_data_type"] = pir::StrAttribute::get(
ctx, op_desc.GetAttrIfExists<std::string>("onednn_data_type"));
}
return attribute_map;
}
#endif
Expand Down