Skip to content

Commit

Permalink
Order print attribute map (PaddlePaddle#55518)
Browse files Browse the repository at this point in the history
* fix_ir_printer

* Update ir_printer.cc

* Update ir_printer.cc

* Update ir_printer.cc

* Update ir_printer.cc

* Update ir_printer.cc

* Update paddle/ir/core/ir_printer.cc

Co-authored-by: kangguangli <kangguangli@hotmail.com>

* Update ir_printer.cc

---------

Co-authored-by: kangguangli <kangguangli@hotmail.com>
  • Loading branch information
2 people authored and wyf committed Aug 30, 2023
1 parent bb7e33c commit 0be3ada
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions paddle/ir/core/ir_printer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,14 @@ void IrPrinter::PrintOpResult(const Operation* op) {
}

void IrPrinter::PrintAttributeMap(const Operation* op) {
AttributeMap attributes = op->attributes();
std::map<std::string, Attribute, std::less<std::string>> order_attributes(
attributes.begin(), attributes.end());
os << " {";

PrintInterleave(
op->attributes().begin(),
op->attributes().end(),
order_attributes.begin(),
order_attributes.end(),
[this](std::pair<std::string, Attribute> it) {
this->os << it.first;
this->os << ":";
Expand Down

0 comments on commit 0be3ada

Please sign in to comment.