From 9618b6ba6238824cce4176c64efb25bcabfd7117 Mon Sep 17 00:00:00 2001 From: Guoyu Wang <62914304+gwang-msft@users.noreply.github.com> Date: Fri, 25 Jun 2021 13:25:28 -0700 Subject: [PATCH] Fix mac shared_provider warning (#8153) --- onnxruntime/python/onnxruntime_pybind_state.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/onnxruntime/python/onnxruntime_pybind_state.cc b/onnxruntime/python/onnxruntime_pybind_state.cc index da6ea09dd3..bf652f3f6e 100644 --- a/onnxruntime/python/onnxruntime_pybind_state.cc +++ b/onnxruntime/python/onnxruntime_pybind_state.cc @@ -1619,7 +1619,7 @@ static struct { void addObjectMethodsForTraining(py::module& m); #endif -void CreatePybindStateModule(py::module& m){ +void CreatePybindStateModule(py::module& m) { m.doc() = "pybind11 stateful interface to ONNX runtime"; RegisterExceptions(m); @@ -1680,7 +1680,8 @@ void CreatePybindStateModule(py::module& m){ addOrtValueMethods(m); addIoBindingMethods(m); -#if !defined(ENABLE_TRAINING) && (!defined(ORT_MINIMAL_BUILD) || defined(ORT_EXTENDED_MINIMAL_BUILD) || defined(ORT_MINIMAL_BUILD_CUSTOM_OPS)) +#if !defined(ENABLE_TRAINING) && !defined(__APPLE__) && \ + (!defined(ORT_MINIMAL_BUILD) || defined(ORT_EXTENDED_MINIMAL_BUILD) || defined(ORT_MINIMAL_BUILD_CUSTOM_OPS)) Ort::SessionOptions tmp_options; if (!InitProvidersSharedLibrary()) { const logging::Logger& default_logger = logging::LoggingManager::DefaultLogger();