decouple the python module construction from pybind_state (#8060)

* fix broken tests

* decouple the module construction to a seperate file
This commit is contained in:
Tang, Cheng 2021-06-15 18:52:26 -07:00 committed by GitHub
parent 96cf533c76
commit e31784b6cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View file

@ -0,0 +1,16 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include <pybind11/pybind11.h>
namespace onnxruntime {
namespace python {
namespace py = pybind11;
void CreatePybindStateModule(py::module& m);
PYBIND11_MODULE(onnxruntime_pybind11_state, m) {
CreatePybindStateModule(m);
}
}
}

View file

@ -1610,7 +1610,7 @@ static struct {
void addObjectMethodsForTraining(py::module& m);
#endif
PYBIND11_MODULE(onnxruntime_pybind11_state, m) {
void CreatePybindStateModule(py::module& m){
m.doc() = "pybind11 stateful interface to ONNX runtime";
RegisterExceptions(m);