MLCompilerBridge
Tools for streamlining communication with ML models for compiler optimizations.
Loading...
Searching...
No Matches
ONNXModelRunner.h
Go to the documentation of this file.
1//=== MLModelRunner/C/ONNXModelRunner.h - C API for ONNXModelRunner - C++ -===//
2//
3// Part of the MLCompilerBridge Project, under the Apache License v2.0 with LLVM
4// Exceptions. See the LICENSE file for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===---------------------------------------------------------------------===//
46//===---------------------------------------------------------------------===//
47
48#ifndef ONNX_MODEL_RUNNER_WRAPPER_H
49#define ONNX_MODEL_RUNNER_WRAPPER_H
50
52typedef struct Environment Environment;
53typedef signed Action;
54
55#ifdef __cplusplus
56extern "C" {
57#endif
58
64void env_setStepFunc(Environment *env, float *(*stepFunc)(Action action));
65void env_setResetFunc(Environment *env, float *(*resetFunc)());
66void env_setNextAgent(Environment *env, char *agentName);
67
69ONNXModelRunner *createSingleAgentOMR(char *agent_path);
71int singleAgentEvaluate(ONNXModelRunner *obj, float *inp, int inp_size);
74
75#ifdef __cplusplus
76}
77#endif
78
79#endif // ONNX_MODEL_RUNNER_WRAPPER_H
void evaluate(ONNXModelRunner *obj)
ONNXModelRunner * createSingleAgentOMR(char *agent_path)
ONNXModelRunner * createONNXModelRunner(Environment *env, int numAgents,...)
void env_setStepFunc(Environment *env, float *(*stepFunc)(Action action))
void destroyONNXModelRunner(ONNXModelRunner *obj)
Environment * createEnvironment()
void env_setResetFunc(Environment *env, float *(*resetFunc)())
void env_setNextAgent(Environment *env, char *agentName)
bool env_checkDone(Environment *env)
signed Action
void env_setDone(Environment *env)
void env_resetDone(Environment *env)
void env_setNumFeatures(Environment *env, int numFeatures)
int singleAgentEvaluate(ONNXModelRunner *obj, float *inp, int inp_size)
void destroyEnvironment(Environment *env)
float *(* stepFunc)(Action action)