| 50 | } |
| 51 | |
| 52 | void print_res(const Request& req, |
| 53 | const Response& res, |
| 54 | std::string route_tag, |
| 55 | uint64_t elapse_ms) { |
| 56 | for (uint32_t i = 0; i < res.predictions_size(); ++i) { |
| 57 | const Float32TensorPredictor& prediction = res.predictions(i); |
| 58 | std::ostringstream oss1; |
| 59 | for (uint32_t j = 0; j < prediction.data_size(); ++j) { |
| 60 | oss1 << prediction.data(j) << " "; |
| 61 | } |
| 62 | |
| 63 | std::ostringstream oss2; |
| 64 | for (uint32_t j = 0; j < prediction.shape_size(); ++j) { |
| 65 | oss2 << prediction.shape(j) << " "; |
| 66 | } |
| 67 | LOG(INFO) << "Receive result " << oss1.str() << ", shape " << oss2.str(); |
| 68 | } |
| 69 | |
| 70 | LOG(INFO) << "Succ call predictor[int64tensor_format], the tag is: " |
| 71 | << route_tag << ", elapse_ms: " << elapse_ms; |
| 72 | } |
| 73 | |
| 74 | int main(int argc, char** argv) { |
| 75 | PredictorApi api; |