From e9b8feacb6cd5b96a5bd3bd843c51004221bf372 Mon Sep 17 00:00:00 2001 From: zhangbo9674 <82555433+zhangbo9674@users.noreply.github.com> Date: Mon, 17 Jul 2023 17:38:09 +0800 Subject: [PATCH] fix bug (#55471) --- paddle/fluid/ir/interface/op_yaml_info_parser.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/ir/interface/op_yaml_info_parser.cc b/paddle/fluid/ir/interface/op_yaml_info_parser.cc index b21e4f82a70..58936631a9f 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; -- GitLab