From 628ee72c739a7e0afadc3e6df7a88f418ab9fd4e Mon Sep 17 00:00:00 2001 From: hanbuhe Date: Thu, 16 Aug 2018 17:28:11 +0800 Subject: [PATCH] fix tensor print bug on FPGA --- src/framework/tensor.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/framework/tensor.h b/src/framework/tensor.h index 403768f858..6fc16a01a2 100644 --- a/src/framework/tensor.h +++ b/src/framework/tensor.h @@ -351,9 +351,12 @@ inline Print &operator<<(Print &printer, const Tensor &tensor) { printer << " dims: " << tensor.dims() << "\n"; int stride = tensor.numel() / 20; stride = stride > 0 ? stride : 1; +#ifndef PADDLE_MOBILE_FPGA for (int i = 0; i < tensor.numel(); i += stride) { printer << tensor.data()[i] << " "; } +#endif + return printer; } -- GitLab