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

Merge pull request #12633 from chenwhql/demangle_type_name

Error message refine: add demangle api to attribute type
...@@ -128,7 +128,8 @@ struct ExtractAttribute { ...@@ -128,7 +128,8 @@ struct ExtractAttribute {
attr_value = &boost::get<T>(attr); attr_value = &boost::get<T>(attr);
} catch (boost::bad_get& bad_get) { } catch (boost::bad_get& bad_get) {
PADDLE_THROW("Cannot get attribute %s by type %s, its type is %s", PADDLE_THROW("Cannot get attribute %s by type %s, its type is %s",
attr_name_, typeid(T).name(), attr.type().name()); attr_name_, paddle::platform::demangle(typeid(T).name()),
paddle::platform::demangle(attr.type().name()));
} }
return attr_value; return attr_value;
} }
...@@ -160,7 +161,7 @@ struct ExtractAttribute<bool> { ...@@ -160,7 +161,7 @@ struct ExtractAttribute<bool> {
attr_value = &boost::get<bool>(attr); attr_value = &boost::get<bool>(attr);
} catch (boost::bad_get& bad_get) { } catch (boost::bad_get& bad_get) {
PADDLE_THROW("Cannot get attribute %s by type bool, its type is %s", PADDLE_THROW("Cannot get attribute %s by type bool, its type is %s",
attr_name_, attr.type().name()); attr_name_, paddle::platform::demangle(attr.type().name()));
} }
return attr_value; return attr_value;
} }
...@@ -186,7 +187,7 @@ struct ExtractAttribute<int64_t> { ...@@ -186,7 +187,7 @@ struct ExtractAttribute<int64_t> {
attr_value = &boost::get<int64_t>(attr); attr_value = &boost::get<int64_t>(attr);
} catch (boost::bad_get& bad_get) { } catch (boost::bad_get& bad_get) {
PADDLE_THROW("Cannot get attribute %s by type int64_t, its type is %s", PADDLE_THROW("Cannot get attribute %s by type int64_t, its type is %s",
attr_name_, attr.type().name()); attr_name_, paddle::platform::demangle(attr.type().name()));
} }
return attr_value; return attr_value;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册