提交 876ddff9 编写于 作者: C Chon 提交者: GitHub

Merge pull request #794 from chonwhite/develop

#793:fix tensor print bug on FPGA
...@@ -351,9 +351,12 @@ inline Print &operator<<(Print &printer, const Tensor &tensor) { ...@@ -351,9 +351,12 @@ inline Print &operator<<(Print &printer, const Tensor &tensor) {
printer << " dims: " << tensor.dims() << "\n"; printer << " dims: " << tensor.dims() << "\n";
int stride = tensor.numel() / 20; int stride = tensor.numel() / 20;
stride = stride > 0 ? stride : 1; stride = stride > 0 ? stride : 1;
#ifndef PADDLE_MOBILE_FPGA
for (int i = 0; i < tensor.numel(); i += stride) { for (int i = 0; i < tensor.numel(); i += stride) {
printer << tensor.data<float>()[i] << " "; printer << tensor.data<float>()[i] << " ";
} }
#endif
return printer; return printer;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册