Onnxruntime c接口说明及 动态调用示例

Onnxruntime c接口说明及动态调用示例

背景:

需要onnx模型推理的功能,直接引用onnxruntime代码会引起编译问题。所以考虑动态加载onnxruntime的动态库完成。C++的接口依然需要源码依赖,所以考虑使用onnxruntime的c接口。

1.How to access Onnxruntime C API:

要访问c api,需要拿到 c api的函数指针,而onnxruntime 的所有capi定义在 一个结构体中:

https://github.com/microsoft/onnxruntime/blob/master/onnxruntime/include/onnxruntime/core/session/onnxruntime_c_api.h

struct OrtApi {


版权声明:本文为atp1992原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。