提交 2b0d88e3 编写于 作者: S simson

fix the bug of get id that string might has conflict with int

上级 9cb1ae8a
......@@ -137,10 +137,10 @@ static std::string GetId(const py::object &obj) {
}
if (py::isinstance<mindspore::Type>(to_process)) {
auto type_ptr = py::cast<mindspore::TypePtr>(to_process);
return prefix + type_ptr->ToString();
return "type" + type_ptr->ToString();
}
if (py::isinstance<py::str>(to_process)) {
return prefix + std::string(py::str(to_process));
return "s" + std::string(py::str(to_process));
}
if (py::isinstance<py::int_>(to_process)) {
return prefix + std::string(py::str(to_process));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册