未验证 提交 f71e6a41 编写于 作者: H hong 提交者: GitHub

Fix op compat info (#55032)

* fix op compat info

* fix find first of
上级 5d40f2a2
......@@ -82,9 +82,10 @@ class OpNameNormalizer {
std::string target = "_grad";
std::string data = "@GRAD";
size_t first_grad_pos = arg_name.find_first_of(target);
std::string legacy_name =
this->GetLegacyArgName(op_type, arg_name.substr(0, first_grad_pos));
size_t first_grad_pos = arg_name.find(target);
size_t type_pos = op_type.find(target);
std::string legacy_name = this->GetLegacyArgName(
op_type.substr(0, type_pos), arg_name.substr(0, first_grad_pos));
legacy_name += arg_name.substr(first_grad_pos);
for (size_t pos = 0;
legacy_name.npos != (pos = legacy_name.find(target, pos));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册