mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
Fix the bug of C++ sample in CANN EP file (#23186)
### Description Fix the bug of C++ sample in CANN EP file
This commit is contained in:
parent
af2f2d517c
commit
c67816d65b
1 changed files with 2 additions and 1 deletions
|
|
@ -256,6 +256,7 @@ void output_postprocess(std::vector<Ort::Value>& output_tensors) {
|
|||
*/
|
||||
void inference() {
|
||||
const auto& api = Ort::GetApi();
|
||||
Ort::Env env(ORT_LOGGING_LEVEL_WARNING);
|
||||
|
||||
// Enable cann graph in cann provider option.
|
||||
OrtCANNProviderOptions* cann_options = nullptr;
|
||||
|
|
@ -276,7 +277,7 @@ void inference() {
|
|||
api.SessionOptionsAppendExecutionProvider_CANN(
|
||||
static_cast<OrtSessionOptions*>(session_options), cann_options);
|
||||
|
||||
Ort::Session session(Ort::Env(), model_path, session_options);
|
||||
Ort::Session session(env, model_path, session_options);
|
||||
|
||||
Ort::AllocatorWithDefaultOptions allocator;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue