mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-20 19:12:24 +00:00
refactor prototypes into headers (#4337)
* refactor prototypes into headers
This commit is contained in:
parent
fc5e65a22d
commit
c3c4ce5ceb
4 changed files with 10 additions and 8 deletions
|
|
@ -28,6 +28,8 @@ MLDataType NumpyTypeToOnnxRuntimeType(int numpy_type);
|
|||
void CreateGenericMLValue(const onnxruntime::InputDefList* input_def_list, const AllocatorPtr& alloc, const std::string& name_input,
|
||||
py::object& value, OrtValue* p_mlvalue);
|
||||
|
||||
void GetPyObjFromTensor(const Tensor& rtensor, py::object& obj, const DataTransferManager* data_transfer_manager = nullptr);
|
||||
|
||||
template <class T>
|
||||
struct DecRefFn {
|
||||
void operator()(T* pyobject) const {
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ void AddNonTensor(const OrtValue& val, std::vector<py::object>& pyobjs) {
|
|||
pyobjs.push_back(py::cast(val.Get<T>()));
|
||||
}
|
||||
|
||||
void GetPyObjFromTensor(const Tensor& rtensor, py::object& obj, const DataTransferManager* data_transfer_manager = nullptr) {
|
||||
void GetPyObjFromTensor(const Tensor& rtensor, py::object& obj, const DataTransferManager* data_transfer_manager) {
|
||||
std::vector<npy_intp> npy_dims;
|
||||
const TensorShape& shape = rtensor.Shape();
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,10 @@
|
|||
#include "core/framework/session_options.h"
|
||||
|
||||
#include "core/session/environment.h"
|
||||
|
||||
namespace onnxruntime {
|
||||
class InferenceSession;
|
||||
|
||||
namespace python {
|
||||
|
||||
using namespace onnxruntime;
|
||||
|
|
@ -46,6 +49,8 @@ class SessionObjectInitializer {
|
|||
|
||||
Environment& get_env();
|
||||
|
||||
void InitializeSession(InferenceSession* sess, const std::vector<std::string>& provider_types);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
#include "orttraining/core/session/training_session.h"
|
||||
#include "orttraining/core/graph/optimizer_config.h"
|
||||
#include "orttraining/core/framework/mpi_setup.h"
|
||||
#include "python/onnxruntime_pybind_mlvalue.h"
|
||||
|
||||
|
||||
namespace onnxruntime {
|
||||
namespace python {
|
||||
|
|
@ -19,13 +21,6 @@ namespace py = pybind11;
|
|||
using namespace onnxruntime;
|
||||
using namespace onnxruntime::logging;
|
||||
|
||||
// BEGIN: forward declaration for stuff in onnxruntime_pybind_state
|
||||
void InitializeSession(InferenceSession* sess, const std::vector<std::string>& provider_types);
|
||||
void GetPyObjFromTensor(const Tensor& rtensor, py::object& obj, const DataTransferManager* data_transfer_manager = nullptr);
|
||||
void CreateGenericMLValue(const onnxruntime::InputDefList* input_def_list, const AllocatorPtr& alloc, const std::string& name_input,
|
||||
py::object& value, OrtValue* p_mlvalue);
|
||||
// END: forward declaration
|
||||
|
||||
struct TrainingParameters {
|
||||
std::string loss_output_name;
|
||||
std::unordered_set<std::string> weights_to_train;
|
||||
|
|
|
|||
Loading…
Reference in a new issue