未验证 提交 e7dcdb79 编写于 作者: W wanghuancoder 提交者: GitHub

fix attr can not find in mkldnn, test=develop (#34567)

上级 61e51c18
...@@ -104,7 +104,10 @@ PreparedOp PrepareImpl(const NameVarMap<VarType>& ins, ...@@ -104,7 +104,10 @@ PreparedOp PrepareImpl(const NameVarMap<VarType>& ins,
// Const qualifier of Attrs had to be discarded to overwrite it. // Const qualifier of Attrs had to be discarded to overwrite it.
if (FLAGS_use_mkldnn) { if (FLAGS_use_mkldnn) {
auto& mutable_op_attrs = const_cast<framework::AttributeMap&>(op.Attrs()); auto& mutable_op_attrs = const_cast<framework::AttributeMap&>(op.Attrs());
mutable_op_attrs = attrs; mutable_op_attrs = default_attrs;
for (auto& attr : attrs) {
mutable_op_attrs[attr.first] = attr.second;
}
} }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册