未验证 提交 713c4d0d 编写于 作者: C Chen Weihang 提交者: GitHub

fix custom op attr names size error (#44938)

上级 75d306ff
......@@ -333,8 +333,7 @@ static std::vector<paddle::any> CastAttrsToTragetType(
src.size()));
for (size_t i = 0; i < src.size(); i++) {
size_t end = attrs_names[i].find(": ");
std::string type_name =
attrs_names[i].substr(end + 2, attrs_names.size() - end - 2);
std::string type_name = attrs_names[i].substr(end + 2);
if (type_name == "int") {
if (src[i].type() == typeid(bool)) {
res.emplace_back(static_cast<int>(paddle::any_cast<bool>(src[i])));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册