diff --git a/onnxruntime/python/onnxruntime_pybind_state.cc b/onnxruntime/python/onnxruntime_pybind_state.cc index 387d996c98..05bed14739 100644 --- a/onnxruntime/python/onnxruntime_pybind_state.cc +++ b/onnxruntime/python/onnxruntime_pybind_state.cc @@ -1502,9 +1502,7 @@ void CreateInferencePybindStateModule(py::module& m) { addSparseTensorMethods(m); addIoBindingMethods(m); -#if !defined(__APPLE__) && \ - (!defined(ORT_MINIMAL_BUILD) || defined(ORT_EXTENDED_MINIMAL_BUILD) || defined(ORT_MINIMAL_BUILD_CUSTOM_OPS)) - Ort::SessionOptions tmp_options; +#if !defined(__APPLE__) && !defined(ORT_MINIMAL_BUILD) if (!InitProvidersSharedLibrary()) { const logging::Logger& default_logger = logging::LoggingManager::DefaultLogger(); LOGS(default_logger, WARNING) << "Init provider bridge failed.";