Skip to content

Commit

Permalink
tensor formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
Thunderbrook committed Sep 2, 2021
1 parent 67ed7e1 commit 4f489ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion paddle/fluid/operators/tensor_formatter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ void TensorFormatter::FormatData(const framework::LoDTensor& print_tensor,
? print_tensor.numel()
: std::min(summarize_, print_tensor.numel());
const T* data = nullptr;
framework::LoDTensor cpu_tensor;
if (is_cpu_place(print_tensor.place())) {
data = print_tensor.data<T>();
} else {
framework::LoDTensor cpu_tensor;
platform::CPUPlace cpu_place;
TensorCopy(print_tensor, cpu_place, &cpu_tensor);
#ifdef PADDLE_WITH_ASCEND_CL
Expand Down

1 comment on commit 4f489ef

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.