MCPcopy Create free account
hub / github.com/PaddlePaddle/Serving / print_res

Function print_res

tools/cpp_examples/demo-client/src/sparse_format.cpp:55–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected