175 std::vector<std::unique_ptr<tc::InferInput>> inputs;
176 inputs.reserve(inputData.size());
178 for (
auto& [inputName, inputInfo] : inputData) {
180 const std::vector<int64_t>& inputShape = inputInfo.first;
184 [&](
const auto& dataVec) {
185 using T = std::decay_t<
decltype(dataVec[0])>;
186 return m_impl->prepareInput<T>(inputName, inputShape, dataVec,
193 std::vector<tc::InferInput*> rawInputs;
194 for (
auto& input : inputs) {
195 rawInputs.push_back(input.get());
199 tc::InferenceServerGrpcClient* client =
nullptr;
201 assert(client !=
nullptr);
204 std::shared_ptr<tc::InferResult> results;
205 tc::Headers http_headers;
206 grpc_compression_algorithm compression_algorithm =
207 grpc_compression_algorithm::GRPC_COMPRESS_NONE;
209 if (
m_impl->m_parentAsyncAlg ==
nullptr) {
210 tc::InferResult* rawResultPtr =
nullptr;
212 {}, http_headers, compression_algorithm));
213 assert(rawResultPtr !=
nullptr);
214 results.reset(rawResultPtr);
217 using Promise_t = boost::fibers::promise<tc::InferResult*>;
218 using Future_t = boost::fibers::future<tc::InferResult*>;
220 Future_t future = promise.get_future();
221 auto callback = [&promise](tc::InferResult* resultPtr) {
222 assert(resultPtr !=
nullptr);
223 promise.set_value(resultPtr);
226 {}, http_headers, compression_algorithm));
227 results.reset(future.get());
232 for (
auto& [outputName, outputInfo] : outputData) {
238 using T = std::decay_t<
decltype(dataVec[0])>;
239 return m_impl->extractOutput<T>(outputName, *results, dataVec);
245 return StatusCode::SUCCESS;