未验证 提交 74938395 编写于 作者: J Jiabin Yang 提交者: GitHub

add shape info into eager log (#46934)

上级 328236d2
......@@ -257,18 +257,21 @@ class EagerUtils {
} else {
tensor_name_str = t.name();
}
const char* TENSOR_INFO_TEMPLATE = "Type: %s, Dtype: %s, Place: %s";
const char* TENSOR_INFO_TEMPLATE =
"Type: %s, Dtype: %s, Place: %s, Shape: %s";
std::string tensor_info_str = "";
if (t.defined()) {
if (t.initialized()) {
tensor_info_str += paddle::string::Sprintf(TENSOR_INFO_TEMPLATE,
t.impl()->type_info().name(),
t.dtype(),
t.place().DebugString());
t.place().DebugString(),
t.dims());
} else {
tensor_info_str += paddle::string::Sprintf(TENSOR_INFO_TEMPLATE,
t.impl()->type_info().name(),
"Unknown",
"Unknown",
"Unknown");
}
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册