onnxruntime/docs/C_API.md
Ryan Hill 3b1140954e Bug bash (#43)
* Update README.md

* Update Versioning.md

* Update rename_manylinux.sh

Remove duplicate word

* Update README.md

Remove a 'the' as ONNX Runtime is a proper noun.

* Update CUDA version to 9.1 cudnn version to 7.1

* Update ReleaseManagement.md

* put tensorflow copy-right headers

there are around 10 lines of code is borrowed from tflite.

* Update README.md

Mention C++ API

* Update README.md

Fix link

* Update C_API.md

Fix broken link to onnxruntime_c_api.h

* Update ABI.md

Delete mention of COM and fix 'ONNX Runtime' to be two words

* Update README.md

* Update README.md

* Update C_API.md
2018-11-27 18:52:50 -08:00

26 lines
1.2 KiB
Markdown

# C API
**NOTE: The C API is PRE-RELEASE and subject to change. Please do not rely on this file not changing.**
## 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.
## How to use it
1. Include [onnxruntime_c_api.h](/include/onnxruntime/core/session/onnxruntime_c_api.h).
2. Call ONNXRuntimeInitialize
3. Create Session: ONNXRuntimeCreateInferenceSession(env, model_uri, nullptr,...)
4. Create Tensor
1) ONNXRuntimeCreateAllocatorInfo
2) ONNXRuntimeCreateTensorWithDataAsONNXValue
5. ONNXRuntimeRunInference