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

Function print_res

tools/cpp_examples/demo-client/src/int64tensor_format.cpp:52–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52void 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
74int main(int argc, char** argv) {
75 PredictorApi api;

Callers 1

mainFunction · 0.70

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected