diff --git a/paddle/fluid/ir_adaptor/translator/op_compat_info.h b/paddle/fluid/ir_adaptor/translator/op_compat_info.h index 1bb2f4d8131b4af00c27c3e8b74f2b7ea4c8bdc3..a56bcfa3392ae5b2f40b320038e0a3e52a09ae99 100644 --- a/paddle/fluid/ir_adaptor/translator/op_compat_info.h +++ b/paddle/fluid/ir_adaptor/translator/op_compat_info.h @@ -116,6 +116,13 @@ class OpNameNormalizer { std::string GetLegacyAttrName(const std::string& op_type, const std::string& arg_name) { + size_t type_pos = op_type.find(kPhiGradSuffix); + if (type_pos != std::string::npos) { + std::string legacy_name = + this->GetLegacyAttrName(op_type.substr(0, type_pos), arg_name); + return legacy_name; + } + if (op_arg_name_mappings.find(op_type) == op_arg_name_mappings.end()) { VLOG(10) << "[" << op_type << "] not found"; return arg_name;