- ONNX Support
- Format Conversion
- Automatic data type conversion
- Creating a Model
- Running a model
- Validation in the Strategy Tester
- OnnxCreate
- OnnxCreateFromBuffer
- OnnxRelease
- OnnxRun
- OnnxGetInputCount
- OnnxGetOutputCount
- OnnxGetInputName
- OnnxGetOutputName
- OnnxGetInputTypeInfo
- OnnxGetOutputTypeInfo
- OnnxSetInputShape
- OnnxSetOutputShape
- Data structures
OnnxRun
Run an ONNX model.
bool OnnxRun(
|
Parameters
onnx_handle
[in] ONNX session object handle created via OnnxCreate or OnnxCreateFromBuffer.
flags
[in] Flags from ENUM_ONNX_FLAGS describing the run mode: ONNX_DEBUG_LOGS and ONNX_NO_CONVERSION.
...
[in] [out] Model inputs and outputs.
Returns true on success or false otherwise. To obtain the error code, call the GetLastError function.
ENUM_ONNX_FLAGS
ID |
Description |
|---|---|
ONNX_LOGLEVEL_VERBOSE |
Log all messages |
ONNX_LOGLEVEL_INFO |
Log info messages, warnings, and errors (this flag replaces ONNX_DEBUG_LOGS) |
ONNX_LOGLEVEL_WARNING |
Log warnings and errors (default) |
ONNX_LOGLEVEL_ERROR |
Log errors only |
ONNX_NO_CONVERSION |
Disable auto conversion, use user data as is |
ONNX_COMMON_FOLDER |
Load a model file from the Common\Files folder; the value is equal to the FILE_COMMON flag |
ONNX_USE_CPU_ONLY |
Execute the ONNX model using CPU only |
ONNX_GPU_DEVICE_0 |
CUDA device with index 0 (default) |
ONNX_GPU_DEVICE_1 |
CUDA device with index 1 * |
ONNX_GPU_DEVICE_2 |
CUDA device with index 2 * |
ONNX_GPU_DEVICE_3 |
CUDA device with index 3 * |
ONNX_GPU_DEVICE_4 |
CUDA device with index 4 * |
ONNX_GPU_DEVICE_5 |
CUDA device with index 5 * |
ONNX_GPU_DEVICE_6 |
CUDA device with index 6 * |
ONNX_GPU_DEVICE_7 |
CUDA device with index 7 * |
ONNX_ENABLE_PROFILING |
Enable ONNX model profiling |
* Flags of the form ONNX_GPU_DEVICE_N should be used on systems with two or more CUDA-capable GPUs. If multiple GPU selection flags are specified, the device with the lowest index will be used.
If a non-existent device index is specified, the GPU will be selected automatically.
Example:
const long ExtOutputShape[] = {1,1}; // model output shape
|
See also