提交 dd0c0595 编写于 作者: J Jiaying Zhao 提交者: StarryRain

fix fpga ci build error (#2127)

* fix fpga ci build error. test=develop

* fix fpga ci build error. test=develop
上级 8bee4e29
...@@ -104,7 +104,7 @@ void dump_stride_float(std::string filename, ...@@ -104,7 +104,7 @@ void dump_stride_float(std::string filename,
void dump_stride(std::string filename, void dump_stride(std::string filename,
paddle_mobile::PaddleTensor input_tensor) { paddle_mobile::PaddleTensor input_tensor) {
if (input_tensor.dtypeid == type_id<float>().hash_code()) { if (input_tensor.dtypeid == PaddlekTypeId_t::paddle_float) {
dump_stride_float(filename, input_tensor); dump_stride_float(filename, input_tensor);
} else { } else {
std::cout << "only support dumping float data" << std::endl; std::cout << "only support dumping float data" << std::endl;
...@@ -156,13 +156,13 @@ int main() { ...@@ -156,13 +156,13 @@ int main() {
std::cout << "Finishing initializing data" << std::endl; std::cout << "Finishing initializing data" << std::endl;
struct PaddleTensor t_img_info, t_img; struct PaddleTensor t_img_info, t_img;
t_img_info.dtypeid = type_id<float>().hash_code(); t_img_info.dtypeid = PaddlekTypeId_t::paddle_float;
t_img_info.layout = LAYOUT_HWC; t_img_info.layout = LAYOUT_HWC;
t_img_info.shape = std::vector<int>({1, 3}); t_img_info.shape = std::vector<int>({1, 3});
t_img_info.name = "Image information"; t_img_info.name = "Image information";
t_img_info.data.Reset(img_info, 3 * sizeof(float)); t_img_info.data.Reset(img_info, 3 * sizeof(float));
t_img.dtypeid = type_id<float>().hash_code(); t_img.dtypeid = PaddlekTypeId_t::paddle_float;
// quantize(&img, img_length); // quantize(&img, img_length);
// t_img.dtypeid = typeid(int8_t); // t_img.dtypeid = typeid(int8_t);
t_img.layout = LAYOUT_HWC; t_img.layout = LAYOUT_HWC;
...@@ -209,7 +209,7 @@ int main() { ...@@ -209,7 +209,7 @@ int main() {
std::cout << "Finishing initializing data" << std::endl; std::cout << "Finishing initializing data" << std::endl;
struct PaddleTensor t_img1; struct PaddleTensor t_img1;
t_img1.dtypeid = type_id<float>().hash_code(); t_img1.dtypeid = PaddlekTypeId_t::paddle_float;
t_img1.layout = LAYOUT_HWC; t_img1.layout = LAYOUT_HWC;
t_img1.shape = std::vector<int>({1, 14, 14, 144}); t_img1.shape = std::vector<int>({1, 14, 14, 144});
t_img1.name = "Image information"; t_img1.name = "Image information";
......
...@@ -96,7 +96,7 @@ void dump_stride_float(std::string filename, PaddleTensor input_tensor) { ...@@ -96,7 +96,7 @@ void dump_stride_float(std::string filename, PaddleTensor input_tensor) {
} }
void dump_stride(std::string filename, PaddleTensor input_tensor) { void dump_stride(std::string filename, PaddleTensor input_tensor) {
if (input_tensor.dtypeid == type_id<float>().hash_code()) { if (input_tensor.dtypeid == PaddlekTypeId_t::paddle_float) {
dump_stride_float(filename, input_tensor); dump_stride_float(filename, input_tensor);
} else { } else {
std::cout << "only support dumping float data" << std::endl; std::cout << "only support dumping float data" << std::endl;
...@@ -131,7 +131,7 @@ int main() { ...@@ -131,7 +131,7 @@ int main() {
std::cout << "Finishing initializing data" << std::endl; std::cout << "Finishing initializing data" << std::endl;
struct PaddleTensor t_img; struct PaddleTensor t_img;
t_img.dtype = FLOAT32; t_img.dtype = FLOAT32;
t_img.dtypeid = type_id<float>().hash_code(); t_img.dtypeid = PaddlekTypeId_t::paddle_float;
// quantize(&img, img_length); // quantize(&img, img_length);
// t_img.dtype = INT8; // t_img.dtype = INT8;
// t_img.dtypeid = typeid(int8_t); // t_img.dtypeid = typeid(int8_t);
......
...@@ -117,13 +117,13 @@ int main() { ...@@ -117,13 +117,13 @@ int main() {
std::cout << "Finishing initializing data" << std::endl; std::cout << "Finishing initializing data" << std::endl;
struct PaddleTensor t_img_info, t_img; struct PaddleTensor t_img_info, t_img;
t_img.dtypeid = type_id<float>().hash_code(); t_img.dtypeid = PaddlekTypeId_t::paddle_float;
t_img_info.layout = LAYOUT_HWC; t_img_info.layout = LAYOUT_HWC;
t_img_info.shape = std::vector<int>({1, 3}); t_img_info.shape = std::vector<int>({1, 3});
t_img_info.name = "Image information"; t_img_info.name = "Image information";
t_img_info.data.Reset(img_info, 3 * sizeof(float)); t_img_info.data.Reset(img_info, 3 * sizeof(float));
t_img.dtypeid = type_id<float>().hash_code(); t_img.dtypeid = PaddlekTypeId_t::paddle_float;
t_img.layout = LAYOUT_HWC; t_img.layout = LAYOUT_HWC;
t_img.shape = std::vector<int>({1, 432, 1280, 3}); t_img.shape = std::vector<int>({1, 432, 1280, 3});
t_img.name = "Image information"; t_img.name = "Image information";
......
...@@ -95,7 +95,7 @@ void dump_stride_float(std::string filename, PaddleTensor input_tensor) { ...@@ -95,7 +95,7 @@ void dump_stride_float(std::string filename, PaddleTensor input_tensor) {
} }
void dump_stride(std::string filename, PaddleTensor input_tensor) { void dump_stride(std::string filename, PaddleTensor input_tensor) {
if (input_tensor.dtypeid == type_id<float>().hash_code()) { if (input_tensor.dtypeid == PaddlekTypeId_t::paddle_float) {
dump_stride_float(filename, input_tensor); dump_stride_float(filename, input_tensor);
} else { } else {
std::cout << "only support dumping float data" << std::endl; std::cout << "only support dumping float data" << std::endl;
...@@ -134,7 +134,7 @@ int main() { ...@@ -134,7 +134,7 @@ int main() {
// t_img.dtypeid = type_id<float>().hash_code(); // t_img.dtypeid = type_id<float>().hash_code();
quantize(&img, img_length); quantize(&img, img_length);
t_img.dtype = INT8; t_img.dtype = INT8;
t_img.dtypeid = type_id<int8_t>().hash_code(); t_img.dtypeid = PaddlekTypeId_t::paddle_int8_t;
t_img.layout = LAYOUT_HWC; t_img.layout = LAYOUT_HWC;
t_img.shape = std::vector<int>({1, 256, 416, 3}); t_img.shape = std::vector<int>({1, 256, 416, 3});
t_img.name = "Image information"; t_img.name = "Image information";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册