mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-14 20:48:00 +00:00
* Rename OrtInitialize to OrtCreateEnv in preparation for future. Add version number to structures * Forgot about exports * Update documentation
1.1 KiB
1.1 KiB
C API
Features
- Creating an InferenceSession from an on-disk model file and a set of SessionOptions.
- Registering customized loggers.
- Registering customized allocators.
- Registering predefined providers and set the priority order. ONNXRuntime has a set of predefined execution providers,like CUDA, MKLDNN. User can register providers to their InferenceSession. The order of registration indicates the preference order as well.
- Running a model with inputs. These inputs must be in CPU memory, not GPU. If the model has multiple outputs, user can specify which outputs they want.
- Converting an in-memory ONNX Tensor encoded in protobuf format, to a pointer that can be used as model input.
- Setting the thread pool size for each session.
- Dynamically loading custom ops.
Very simplified outline of how to use it
- Include onnxruntime_c_api.h.
- Call OrtCreateEnv
- Create Session: OrtCreateSession(env, model_uri, nullptr,...)
- Create Tensor
- OrtCreateAllocatorInfo
- OrtCreateTensorWithDataAsONNXValue
- OrtRun