提交 1c257ead 编写于 作者: X xulongteng

fix bug

上级 dbcd27ba
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#ifndef SERVING_DEMO_CLIENT_SRC_DATA_PRE_H_ #ifndef SERVING_DEMO_CLIENT_SRC_DATA_PRE_H_
#define SERVING_DEMO_CLIENT_SRC_DATA_PRE_H_ #define SERVING_DEMO_CLIENT_SRC_DATA_PRE_H_
#include <sys/stat.h> #include <sys/stat.h>
#include <iostream>
#include <map> #include <map>
#include <string> #include <string>
#include <vector> #include <vector>
......
...@@ -137,7 +137,7 @@ int BertServiceOp::inference() { ...@@ -137,7 +137,7 @@ int BertServiceOp::inference() {
<< " seq_len : " << out->at(0).shape[1] << " seq_len : " << out->at(0).shape[1]
<< " emb_size : " << out->at(0).shape[2]; << " emb_size : " << out->at(0).shape[2];
float *out_data = reinterpret_cast<float *>out->at(0).data.data(); float *out_data = reinterpret_cast<float *>(out->at(0).data.data());
for (uint32_t bi = 0; bi < batch_size; bi++) { for (uint32_t bi = 0; bi < batch_size; bi++) {
BertResInstance *res_instance = res->add_instances(); BertResInstance *res_instance = res->add_instances();
for (uint32_t si = 0; si < MAX_SEQ_LEN; si++) { for (uint32_t si = 0; si < MAX_SEQ_LEN; si++) {
...@@ -151,7 +151,7 @@ int BertServiceOp::inference() { ...@@ -151,7 +151,7 @@ int BertServiceOp::inference() {
#else #else
LOG(INFO) << "batch_size : " << out->at(0).shape[0] LOG(INFO) << "batch_size : " << out->at(0).shape[0]
<< " emb_size : " << out->at(0).shape[1]; << " emb_size : " << out->at(0).shape[1];
float *out_data = reinterpret_cast<float *> out->at(0).data.data(); float *out_data = reinterpret_cast<float *>(out->at(0).data.data());
for (uint32_t bi = 0; bi < batch_size; bi++) { for (uint32_t bi = 0; bi < batch_size; bi++) {
BertResInstance *res_instance = res->add_instances(); BertResInstance *res_instance = res->add_instances();
for (uint32_t si = 0; si < 1; si++) { for (uint32_t si = 0; si < 1; si++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册