How do multiple model inputs and outputs map to the ONNX Runtime C++ Run call?
ML System DesignLevel: IntermediateTyped inference input contracts
How do multiple model inputs and outputs map to the ONNX Runtime C++ Run call?
Hints
- Match names, tensor values and their counts explicitly.
- Check lifetimes as well as shapes and datatypes.
Answer
Pass corresponding arrays of input names and Ort::Value tensors, plus requested output names. Names, array lengths, element types and shapes must agree with model metadata; positional assumptions can silently bind the wrong data. Keep buffers and name storage alive for the required duration. Validate all outputs, not just the first tensor or a successful return code.
Source and licence: Microsoft — ONNX Runtime FAQ · MIT · answer: Quantoros editorial