提交 4c9d1c5d 编写于 作者: H hanbuhe

fix tensor print bug on FPGA

上级 24dcf067
...@@ -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.
先完成此消息的编辑!
想要评论请 注册