Skip to content

Commit

Permalink
Pass ORT_API_VERSION to OrtApiBase::GetApi()
Browse files Browse the repository at this point in the history
Also removes the inclusion of onnx.pb.h header.
  • Loading branch information
huningxin committed Jan 2, 2025
1 parent 1eb9dfc commit 41b49b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions services/webnn/ort/platform_functions_ort.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "base/logging.h"
#include "base/native_library.h"
#include "base/path_service.h"
#include "third_party/onnx/proto/onnx.pb.h"

namespace webnn::ort {

Expand Down Expand Up @@ -39,8 +38,9 @@ PlatformFunctions::PlatformFunctions() {
return;
}

const OrtApi* ort_api =
ort_get_api_base_proc()->GetApi(onnx::Version::IR_VERSION);
// ORT_API_VERSION is defined in onnxruntime_c_api.h and must be passed to
// `OrtApiBase::OrtApi()`.
const OrtApi* ort_api = ort_get_api_base_proc()->GetApi(ORT_API_VERSION);
if (!ort_api) {
LOG(ERROR) << "[WebNN] Failed to get OrtApi.";
return;
Expand Down

0 comments on commit 41b49b0

Please sign in to comment.