From 1c257ead5b642d0b7355d3d3840e808a36483943 Mon Sep 17 00:00:00 2001 From: xulongteng Date: Fri, 27 Sep 2019 16:25:09 +0800 Subject: [PATCH] fix bug --- demo-client/src/data_pre.h | 1 + demo-serving/op/bert_service_op.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/demo-client/src/data_pre.h b/demo-client/src/data_pre.h index ecd1168d..0d410c25 100644 --- a/demo-client/src/data_pre.h +++ b/demo-client/src/data_pre.h @@ -14,6 +14,7 @@ #ifndef SERVING_DEMO_CLIENT_SRC_DATA_PRE_H_ #define SERVING_DEMO_CLIENT_SRC_DATA_PRE_H_ #include +#include #include #include #include diff --git a/demo-serving/op/bert_service_op.cpp b/demo-serving/op/bert_service_op.cpp index 58ba0470..d393e04a 100644 --- a/demo-serving/op/bert_service_op.cpp +++ b/demo-serving/op/bert_service_op.cpp @@ -137,7 +137,7 @@ int BertServiceOp::inference() { << " seq_len : " << out->at(0).shape[1] << " emb_size : " << out->at(0).shape[2]; - float *out_data = reinterpret_castout->at(0).data.data(); + float *out_data = reinterpret_cast(out->at(0).data.data()); for (uint32_t bi = 0; bi < batch_size; bi++) { BertResInstance *res_instance = res->add_instances(); for (uint32_t si = 0; si < MAX_SEQ_LEN; si++) { @@ -151,7 +151,7 @@ int BertServiceOp::inference() { #else LOG(INFO) << "batch_size : " << out->at(0).shape[0] << " emb_size : " << out->at(0).shape[1]; - float *out_data = reinterpret_cast out->at(0).data.data(); + float *out_data = reinterpret_cast(out->at(0).data.data()); for (uint32_t bi = 0; bi < batch_size; bi++) { BertResInstance *res_instance = res->add_instances(); for (uint32_t si = 0; si < 1; si++) { -- GitLab