diff --git a/paddle/ir/core/ir_printer.cc b/paddle/ir/core/ir_printer.cc index a322e8fca9ffd6e6c13b0f1849fb101c15862ca7..8890364565518ecb0f53816959558459d0388e20 100644 --- a/paddle/ir/core/ir_printer.cc +++ b/paddle/ir/core/ir_printer.cc @@ -215,11 +215,14 @@ void IrPrinter::PrintOpResult(const Operation* op) { } void IrPrinter::PrintAttributeMap(const Operation* op) { + AttributeMap attributes = op->attributes(); + std::map> order_attributes( + attributes.begin(), attributes.end()); os << " {"; PrintInterleave( - op->attributes().begin(), - op->attributes().end(), + order_attributes.begin(), + order_attributes.end(), [this](std::pair it) { this->os << it.first; this->os << ":";