|
|
|
|
@ -75,14 +75,15 @@ int test_predictor_zero_copy(const AnalysisConfig& config_in,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<float> input({1});
|
|
|
|
|
auto in_tensor{predictor->GetInputTensor(predictor->GetInputNames().front())};
|
|
|
|
|
auto in_tensor =
|
|
|
|
|
predictor->GetInputTensor(predictor->GetInputNames().front());
|
|
|
|
|
in_tensor->Reshape({1, 1});
|
|
|
|
|
in_tensor->copy_from_cpu(input.data());
|
|
|
|
|
|
|
|
|
|
predictor->ZeroCopyRun();
|
|
|
|
|
|
|
|
|
|
auto out_tensor{
|
|
|
|
|
predictor->GetOutputTensor(predictor->GetOutputNames().front())};
|
|
|
|
|
auto out_tensor =
|
|
|
|
|
predictor->GetOutputTensor(predictor->GetOutputNames().front());
|
|
|
|
|
std::vector<float> data_o(10);
|
|
|
|
|
out_tensor->copy_to_cpu(data_o.data());
|
|
|
|
|
|
|
|
|
|
|