@@ -132,13 +132,12 @@ int PredictorClient::create_predictor() {
132
132
_api.thrd_initialize ();
133
133
}
134
134
135
- int PredictorClient::predict (
136
- const std::vector<std::vector<float >>& float_feed,
137
- const std::vector<std::string>& float_feed_name,
138
- const std::vector<std::vector<int64_t >>& int_feed,
139
- const std::vector<std::string>& int_feed_name,
140
- const std::vector<std::string>& fetch_name,
141
- PredictorRes & predict_res) { // NOLINT
135
+ int PredictorClient::predict (const std::vector<std::vector<float >> &float_feed,
136
+ const std::vector<std::string> &float_feed_name,
137
+ const std::vector<std::vector<int64_t >> &int_feed,
138
+ const std::vector<std::string> &int_feed_name,
139
+ const std::vector<std::string> &fetch_name,
140
+ PredictorRes &predict_res) { // NOLINT
142
141
predict_res._int64_map .clear ();
143
142
predict_res._float_map .clear ();
144
143
Timer timeline;
@@ -218,6 +217,7 @@ int PredictorClient::predict(
218
217
VLOG (2 ) << " fetch name: " << name;
219
218
if (_fetch_name_to_type[name] == 0 ) {
220
219
int len = res.insts (0 ).tensor_array (idx).int64_data_size ();
220
+ VLOG (2 ) << " fetch tensor : " << name << " type: int64 len : " << len;
221
221
predict_res._int64_map [name].resize (1 );
222
222
predict_res._int64_map [name][0 ].resize (len);
223
223
for (int i = 0 ; i < len; ++i) {
@@ -226,6 +226,7 @@ int PredictorClient::predict(
226
226
}
227
227
} else if (_fetch_name_to_type[name] == 1 ) {
228
228
int len = res.insts (0 ).tensor_array (idx).float_data_size ();
229
+ VLOG (2 ) << " fetch tensor : " << name << " type: float32 len : " << len;
229
230
predict_res._float_map [name].resize (1 );
230
231
predict_res._float_map [name][0 ].resize (len);
231
232
for (int i = 0 ; i < len; ++i) {
@@ -244,18 +245,18 @@ int PredictorClient::predict(
244
245
<< " prepro_1:" << preprocess_end << " "
245
246
<< " client_infer_0:" << client_infer_start << " "
246
247
<< " client_infer_1:" << client_infer_end << " " ;
247
-
248
+
248
249
if (FLAGS_profile_server) {
249
250
int op_num = res.profile_time_size () / 2 ;
250
251
for (int i = 0 ; i < op_num; ++i) {
251
252
oss << " op" << i << " _0:" << res.profile_time (i * 2 ) << " " ;
252
253
oss << " op" << i << " _1:" << res.profile_time (i * 2 + 1 ) << " " ;
253
254
}
254
255
}
255
-
256
+
256
257
oss << " postpro_0:" << postprocess_start << " " ;
257
258
oss << " postpro_1:" << postprocess_end;
258
-
259
+
259
260
fprintf (stderr, " %s\n " , oss.str ().c_str ());
260
261
}
261
262
return 0 ;
@@ -342,7 +343,7 @@ std::vector<std::vector<std::vector<float>>> PredictorClient::batch_predict(
342
343
}
343
344
344
345
VLOG (2 ) << " batch [" << bi << " ] "
345
- << " itn feed value prepared" ;
346
+ << " int feed value prepared" ;
346
347
}
347
348
348
349
int64_t preprocess_end = timeline.TimeStampUS ();
0 commit comments