未验证 提交 e77fd2e6 编写于 作者: T Thunderbrook 提交者: GitHub

tensor formatter (#35399)

上级 ccd42db7
...@@ -119,10 +119,10 @@ void TensorFormatter::FormatData(const framework::LoDTensor& print_tensor, ...@@ -119,10 +119,10 @@ void TensorFormatter::FormatData(const framework::LoDTensor& print_tensor,
? print_tensor.numel() ? print_tensor.numel()
: std::min(summarize_, print_tensor.numel()); : std::min(summarize_, print_tensor.numel());
const T* data = nullptr; const T* data = nullptr;
framework::LoDTensor cpu_tensor;
if (is_cpu_place(print_tensor.place())) { if (is_cpu_place(print_tensor.place())) {
data = print_tensor.data<T>(); data = print_tensor.data<T>();
} else { } else {
framework::LoDTensor cpu_tensor;
platform::CPUPlace cpu_place; platform::CPUPlace cpu_place;
TensorCopy(print_tensor, cpu_place, &cpu_tensor); TensorCopy(print_tensor, cpu_place, &cpu_tensor);
#ifdef PADDLE_WITH_ASCEND_CL #ifdef PADDLE_WITH_ASCEND_CL
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册