This file defines the C APIs for ONNXModelRunner.
This is a wrapper around the ONNXModelRunner class that provides an interface for the MLCompilerBridge to interact with the ONNX models during inference.
Usage for single agent:
- Create an ONNXModelRunner object using createSingleAgentOMR
- Evaluate the features using singleAgentEvaluate
- Destroy the instance of ONNXModelRunner using destroyONNXModelRunner
Usage for multiple agents:
- Create an Environment object using createEnvironment
- Set the number of features using env_setNumFeatures
- Set the step function using env_setStepFunc
- Set the reset function using env_setResetFunc
- Set the next agent using env_setNextAgent
- Create an ONNXModelRunner object using createONNXModelRunner
- Evaluate the features using evaluate
- Destroy the instance of ONNXModelRunner using destroyONNXModelRunner
- Destroy the instance of Environment using destroyEnvironment
Using Environment:
- Create an Environment object using createEnvironment
- Set the number of features using env_setNumFeatures
- Set the step function using env_setStepFunc
- Set the reset function using env_setResetFunc
- Set the next agent using env_setNextAgent
- Destroy the instance of Environment using destroyEnvironment after calling destroyONNXModelRunner.
Internally, the ONNXModelRunner will call the step function to get the next action and the reset function to reset the environment. The step function should return a pointer to an array of floats. The reset function should return a pointer to an array of floats.
Definition in file ONNXModelRunner.h.