This directory contains one C/C++ sample for demonstrating onnxruntime custom operators:
- download onnxruntime binaries (onnxruntime-linux-xx.tgz or onnxruntime-win-x64-xx.zip) from onnxruntime release site
- cmake(version >=3.13)
- onnx
- Run python kenerl.py to generate the onnx model file which contains the custom op.
- Unzip the onnxruntime binaries to any folder. The folder you unzip it to will be your ONNXRUNTIME_ROOTDIR path.
- Open a terminal and change your current directory to samples/c_cxx/customop, and run the below command.
- mkdir build && cd build
- cmake .. -DONNXRUNTIME_ROOTDIR=/path/to/your/onnxruntime
- cmake --build . --config Release
- Add the path of the ONNXRUNTIME_ROOTDIR in
LD_LIBRARY_PATH
on Linux orPATH
on Windows. - Copy the model generated in step 1 and Run the executable file in the build folder.