From 4c9d1c5dde8c97a5c77807116fb0f1563d0b16d0 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