2021-06-16 01:52:26 +00:00
|
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
|
// Licensed under the MIT License.
|
|
|
|
|
|
2021-11-18 06:58:02 +00:00
|
|
|
#include "onnxruntime_pybind.h" // must use this for the include of <pybind11/pybind11.h>
|
2021-09-01 03:51:22 +00:00
|
|
|
#include <pybind11/stl.h>
|
|
|
|
|
#include "core/providers/get_execution_providers.h"
|
2023-03-03 01:11:07 +00:00
|
|
|
#include "onnxruntime_config.h"
|
2021-06-16 01:52:26 +00:00
|
|
|
|
|
|
|
|
namespace onnxruntime {
|
|
|
|
|
namespace python {
|
|
|
|
|
namespace py = pybind11;
|
|
|
|
|
|
2021-08-27 23:23:35 +00:00
|
|
|
void CreateInferencePybindStateModule(py::module& m);
|
2021-06-16 01:52:26 +00:00
|
|
|
|
|
|
|
|
PYBIND11_MODULE(onnxruntime_pybind11_state, m) {
|
2021-08-27 23:23:35 +00:00
|
|
|
CreateInferencePybindStateModule(m);
|
2021-09-01 03:51:22 +00:00
|
|
|
// move it out of shared method since training build has a little different behavior.
|
|
|
|
|
m.def(
|
|
|
|
|
"get_available_providers", []() -> const std::vector<std::string>& { return GetAvailableExecutionProviderNames(); },
|
|
|
|
|
"Return list of available Execution Providers in this installed version of Onnxruntime. "
|
|
|
|
|
"The order of elements represents the default priority order of Execution Providers "
|
|
|
|
|
"from highest to lowest.");
|
2023-03-03 01:11:07 +00:00
|
|
|
|
|
|
|
|
m.def("get_version_string", []() -> std::string { return ORT_VERSION; });
|
2023-04-29 04:57:31 +00:00
|
|
|
m.def("get_build_info", []() -> std::string { return ORT_BUILD_INFO; });
|
2021-06-16 01:52:26 +00:00
|
|
|
}
|
2021-11-18 06:58:02 +00:00
|
|
|
} // namespace python
|
|
|
|
|
} // namespace onnxruntime
|