Skip to content

Commit

Permalink
Fix the bug of C++ sample in CANN EP file
Browse files Browse the repository at this point in the history
  • Loading branch information
bachelor-dou committed Dec 24, 2024
1 parent af2f2d5 commit 4941276
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down

0 comments on commit 4941276

Please sign in to comment.