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

Function create_req

tools/cpp_examples/demo-client/src/ximage_press.cpp:87–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87int create_req(Request& req) { // NOLINT
88 for (int i = 0; i < FLAGS_batch_size; ++i) {
89 XImageReqInstance* ins = req.add_instances();
90 if (!ins) {
91 LOG(ERROR) << "Failed create req instance";
92 return -1;
93 }
94
95 int id = i % g_image_data.size();
96 ins->set_image_binary(g_image_data[id], g_image_lengths[id]);
97 ins->set_image_length(g_image_lengths[id]);
98 }
99
100 return 0;
101}
102
103void extract_res(const Request& req, const Response& res) {
104 uint32_t sample_size = res.predictions_size();

Callers 1

thread_workerFunction · 0.70

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected