From a0b46ddd6990ed320f3b34eb09e64c193971496e Mon Sep 17 00:00:00 2001 From: Jiaying Zhao Date: Tue, 24 Sep 2019 18:57:40 +0800 Subject: [PATCH] fix fpga ci build error (#2127) * fix fpga ci build error. test=develop * fix fpga ci build error. test=develop --- mobile/test/fpga/test_marker_api.cpp | 8 ++++---- mobile/test/fpga/test_mobilenet_api.cpp | 4 ++-- mobile/test/fpga/test_rfcn_api.cpp | 4 ++-- mobile/test/fpga/test_yolo_api.cpp | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mobile/test/fpga/test_marker_api.cpp b/mobile/test/fpga/test_marker_api.cpp index 29cf6561df..19e051a38d 100644 --- a/mobile/test/fpga/test_marker_api.cpp +++ b/mobile/test/fpga/test_marker_api.cpp @@ -104,7 +104,7 @@ void dump_stride_float(std::string filename, void dump_stride(std::string filename, paddle_mobile::PaddleTensor input_tensor) { - if (input_tensor.dtypeid == type_id().hash_code()) { + if (input_tensor.dtypeid == PaddlekTypeId_t::paddle_float) { dump_stride_float(filename, input_tensor); } else { std::cout << "only support dumping float data" << std::endl; @@ -156,13 +156,13 @@ int main() { std::cout << "Finishing initializing data" << std::endl; struct PaddleTensor t_img_info, t_img; - t_img_info.dtypeid = type_id().hash_code(); + t_img_info.dtypeid = PaddlekTypeId_t::paddle_float; t_img_info.layout = LAYOUT_HWC; t_img_info.shape = std::vector({1, 3}); t_img_info.name = "Image information"; t_img_info.data.Reset(img_info, 3 * sizeof(float)); - t_img.dtypeid = type_id().hash_code(); + t_img.dtypeid = PaddlekTypeId_t::paddle_float; // quantize(&img, img_length); // t_img.dtypeid = typeid(int8_t); t_img.layout = LAYOUT_HWC; @@ -209,7 +209,7 @@ int main() { std::cout << "Finishing initializing data" << std::endl; struct PaddleTensor t_img1; - t_img1.dtypeid = type_id().hash_code(); + t_img1.dtypeid = PaddlekTypeId_t::paddle_float; t_img1.layout = LAYOUT_HWC; t_img1.shape = std::vector({1, 14, 14, 144}); t_img1.name = "Image information"; diff --git a/mobile/test/fpga/test_mobilenet_api.cpp b/mobile/test/fpga/test_mobilenet_api.cpp index 09392e9d38..5c0a594ca8 100644 --- a/mobile/test/fpga/test_mobilenet_api.cpp +++ b/mobile/test/fpga/test_mobilenet_api.cpp @@ -96,7 +96,7 @@ void dump_stride_float(std::string filename, PaddleTensor input_tensor) { } void dump_stride(std::string filename, PaddleTensor input_tensor) { - if (input_tensor.dtypeid == type_id().hash_code()) { + if (input_tensor.dtypeid == PaddlekTypeId_t::paddle_float) { dump_stride_float(filename, input_tensor); } else { std::cout << "only support dumping float data" << std::endl; @@ -131,7 +131,7 @@ int main() { std::cout << "Finishing initializing data" << std::endl; struct PaddleTensor t_img; t_img.dtype = FLOAT32; - t_img.dtypeid = type_id().hash_code(); + t_img.dtypeid = PaddlekTypeId_t::paddle_float; // quantize(&img, img_length); // t_img.dtype = INT8; // t_img.dtypeid = typeid(int8_t); diff --git a/mobile/test/fpga/test_rfcn_api.cpp b/mobile/test/fpga/test_rfcn_api.cpp index e86743cc7e..b8b031bf59 100644 --- a/mobile/test/fpga/test_rfcn_api.cpp +++ b/mobile/test/fpga/test_rfcn_api.cpp @@ -117,13 +117,13 @@ int main() { std::cout << "Finishing initializing data" << std::endl; struct PaddleTensor t_img_info, t_img; - t_img.dtypeid = type_id().hash_code(); + t_img.dtypeid = PaddlekTypeId_t::paddle_float; t_img_info.layout = LAYOUT_HWC; t_img_info.shape = std::vector({1, 3}); t_img_info.name = "Image information"; t_img_info.data.Reset(img_info, 3 * sizeof(float)); - t_img.dtypeid = type_id().hash_code(); + t_img.dtypeid = PaddlekTypeId_t::paddle_float; t_img.layout = LAYOUT_HWC; t_img.shape = std::vector({1, 432, 1280, 3}); t_img.name = "Image information"; diff --git a/mobile/test/fpga/test_yolo_api.cpp b/mobile/test/fpga/test_yolo_api.cpp index f8f1a48abc..161d695418 100644 --- a/mobile/test/fpga/test_yolo_api.cpp +++ b/mobile/test/fpga/test_yolo_api.cpp @@ -95,7 +95,7 @@ void dump_stride_float(std::string filename, PaddleTensor input_tensor) { } void dump_stride(std::string filename, PaddleTensor input_tensor) { - if (input_tensor.dtypeid == type_id().hash_code()) { + if (input_tensor.dtypeid == PaddlekTypeId_t::paddle_float) { dump_stride_float(filename, input_tensor); } else { std::cout << "only support dumping float data" << std::endl; @@ -134,7 +134,7 @@ int main() { // t_img.dtypeid = type_id().hash_code(); quantize(&img, img_length); t_img.dtype = INT8; - t_img.dtypeid = type_id().hash_code(); + t_img.dtypeid = PaddlekTypeId_t::paddle_int8_t; t_img.layout = LAYOUT_HWC; t_img.shape = std::vector({1, 256, 416, 3}); t_img.name = "Image information"; -- GitLab