diff --git a/paddle/fluid/ir/interface/op_yaml_info_parser.cc b/paddle/fluid/ir/interface/op_yaml_info_parser.cc index b21e4f82a70cc9e8af3740abc2f9d53d1e9829bb..58936631a9ff7b2c2efe41aa6c382b9156dd5a79 100644 --- a/paddle/fluid/ir/interface/op_yaml_info_parser.cc +++ b/paddle/fluid/ir/interface/op_yaml_info_parser.cc @@ -89,7 +89,7 @@ const std::map& OpYamlInfoParser::InputName2Id() const { } bool OpYamlInfoParser::HasInplace(const std::string& out_name) const { - auto inplace_info = std::get<3>(op_info_tuple_).inplace; + auto& inplace_info = std::get<3>(op_info_tuple_).inplace; for (size_t i = 0; i < inplace_info.size(); i++) { if (out_name == inplace_info[i].first) { return true; @@ -100,7 +100,7 @@ bool OpYamlInfoParser::HasInplace(const std::string& out_name) const { const std::string& OpYamlInfoParser::InplaceName( const std::string& out_name) const { - auto inplace_info = std::get<3>(op_info_tuple_).inplace; + auto& inplace_info = std::get<3>(op_info_tuple_).inplace; for (size_t i = 0; i < inplace_info.size(); i++) { if (out_name == inplace_info[i].first) { return inplace_info[i].second;