oa::WeightSource

Immutable named-weight source. Implementations may mmap one file, aggregate a sharded manifest, or expose another model container. Returned byte spans remain valid while the source remains alive.

Public Methods

oa::Result<oa::Span<const oa::U8>> oa::WeightSource::bytes(oa::StringView inName)
const WeightInfo * oa::WeightSource::find(oa::StringView inName)
WeightFormat oa::WeightSource::format()
oa::Vector<WeightInfo> oa::WeightSource::list()
oa::HashMap<oa::String, oa::String> oa::WeightSource::metadata()
const oa::Path & oa::WeightSource::path()
oa::Status oa::WeightSource::read(oa::StringView inName, oa::Span<oa::U8> outData, oa::ScalarType inTargetDtype)
oa::Status oa::WeightSource::readMatrix(oa::Engine & inEngine, oa::StringView inName, oa::Matrix & outMatrix, oa::ScalarType inTargetDtype)
oa::U64 oa::WeightSource::sourceBytes()

Constructor & Destructor Documentation

void oa::WeightSource::~WeightSource()
No public source comment is attached to this declaration.

Public Method Documentation

oa::Result<oa::Span<const oa::U8>> oa::WeightSource::bytes( oa::StringView inName )
No public source comment is attached to this declaration.

Parameters

inName
oa::StringView

Returns

oa::Result<oa::Span<const oa::U8>>

The declared return value.

const WeightInfo * oa::WeightSource::find( oa::StringView inName )
No public source comment is attached to this declaration.

Parameters

inName
oa::StringView

Returns

const WeightInfo *

The declared return value.

WeightFormat oa::WeightSource::format()
No public source comment is attached to this declaration.

Returns

WeightFormat

The declared return value.

oa::Vector<WeightInfo> oa::WeightSource::list()
No public source comment is attached to this declaration.

Returns

oa::Vector<WeightInfo>

The declared return value.

oa::HashMap<oa::String, oa::String> oa::WeightSource::metadata()
No public source comment is attached to this declaration.

Returns

oa::HashMap<oa::String, oa::String>

The declared return value.

const oa::Path & oa::WeightSource::path()
No public source comment is attached to this declaration.

Returns

const oa::Path &

The declared return value.

oa::Status oa::WeightSource::read( oa::StringView inName, oa::Span<oa::U8> outData, oa::ScalarType inTargetDtype )
Checked copy with optional scalar conversion. Shape transforms belong to a weight mapping, never to the source backend.

Parameters

inName
oa::StringView

outData
oa::Span<oa::U8>

inTargetDtype
oa::ScalarType

Returns

oa::Status

The declared return value.

oa::Status oa::WeightSource::readMatrix( oa::Engine & inEngine, oa::StringView inName, oa::Matrix & outMatrix, oa::ScalarType inTargetDtype )
No public source comment is attached to this declaration.

Parameters

inEngine
oa::Engine &

inName
oa::StringView

outMatrix
oa::Matrix &

inTargetDtype
oa::ScalarType

Returns

oa::Status

The declared return value.

oa::U64 oa::WeightSource::sourceBytes()
No public source comment is attached to this declaration.

Returns

oa::U64

The declared return value.