[Other] Optimize load model from memory function (#1205)

Optimize option for runtime
This commit is contained in:
Jason
2023-02-01 15:50:38 +08:00
committed by GitHub
parent 29e93fa2dc
commit b4e322af63
5 changed files with 29 additions and 49 deletions

View File

@@ -731,8 +731,8 @@ std::unique_ptr<BaseBackend> TrtBackend::Clone(RuntimeOption& runtime_option,
clone_option.gpu_id = device_id;
clone_option.external_stream_ = stream;
if (runtime_option.model_from_memory_) {
FDASSERT(casted_backend->InitFromPaddle(runtime_option.model_buffer_,
runtime_option.params_buffer_,
FDASSERT(casted_backend->InitFromPaddle(runtime_option.model_file,
runtime_option.params_file,
clone_option),
"Clone model from Paddle failed while initialize TrtBackend.");
} else {