oa::ByteEncoder
BYTE ENCODER - Raw bytes to tensor and back
Static Public Methods
Public Method Documentation
Decode logits [seq_len, 256] back to bytes (argmax)
Parameters
inLogitsconst oa::Matrix &—
Returns
oa::Vector<oa::U8>The declared return value.
Decode bytes back to string
Parameters
inLogitsconst oa::Matrix &—
Returns
oa::StringThe declared return value.
Encode raw bytes to tensor [seq_len] of UInt8
Parameters
inBytesoa::Span<const oa::U8>—
Returns
oa::MatrixThe declared return value.
Audio: raw sample bytes
Parameters
inSamplesoa::Span<const oa::U8>—
inSampleRateoa::I32—
inChannelsoa::I32—
Returns
oa::MatrixThe declared return value.
Encode with batch dimension [1, seq_len]
Parameters
inBytesoa::Span<const oa::U8>—
Returns
oa::MatrixThe declared return value.
Image: raw pixel bytes [H * W * C]
Parameters
inPixelsoa::Span<const oa::U8>—
inWidthoa::I32—
inHeightoa::I32—
inChannelsoa::I32—
Returns
oa::MatrixThe declared return value.
text: just cast string bytes directly
Parameters
inTextoa::StringView—
Returns
oa::MatrixThe declared return value.
Decode with temperature sampling
Parameters
inLogitsconst Matrix &—
inTemperatureF32Default: 1.0F
inTopPF32Default: 0.9F
Returns
Vector<U8>The declared return value.