Onnx::Value
Wraps an OrtValue tensor. Input tensors own their data buffer (ONNX Runtime references the memory, it does not copy it); output tensors borrow memory owned by the runtime.
Constructors
Creates a tensor from a byte buffer (no conversion). shape is only
used by the runtime; data must contain shape.product * type.bytesize bytes.
Wraps an existing buffer as a tensor without copying (allocation-free
path for streaming: fill data in place and recreate the Value).
The caller must keep data alive as long as the Value exists.
Class methods
Instance methods
Decodes waveform tensors to Int16 PCM in place, without allocating:
writes into buf (grown only when a longer result appears — do not
clear it between calls) and returns the sample count. Only the first
count entries of buf are valid. Float audio in [-1,1] is scaled
to PCM16.