Skip to content

Commit 16e9347

Browse files
committed
fix attr can not find in mkldnn, test=develop
1 parent 9e0bb91 commit 16e9347

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

paddle/fluid/imperative/prepared_operator.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ PreparedOp PrepareImpl(const NameVarMap<VarType>& ins,
104104
// Const qualifier of Attrs had to be discarded to overwrite it.
105105
if (FLAGS_use_mkldnn) {
106106
auto& mutable_op_attrs = const_cast<framework::AttributeMap&>(op.Attrs());
107-
mutable_op_attrs = attrs;
107+
mutable_op_attrs = default_attrs;
108+
for (auto& attr : attrs) {
109+
mutable_op_attrs[attr.first] = attr.second;
110+
}
108111
}
109112
#endif
110113

0 commit comments

Comments
 (0)