Type Alias: DataLoader
DataLoader =
object
Defined in: core/model.ts:114
Synchronous random-access reader used only during model initialization.
Reads must return exactly the requested bytes. Native code copies each range into independently owned memory; its release timing depends on the backend. The callbacks are released before loadModel returns, including on failure. Backends requiring later reads or reads on worker threads are not supported by callback sources.
When passed through wrapAsync, callbacks and their captures must be worklet-compatible. Avoid capturing a complete weight archive when the goal is to reduce memory use.
Methods
load()
load(
byteOffset,byteLength):ArrayBuffer
Defined in: core/model.ts:118
Returns exactly byteLength bytes starting at byteOffset.
Parameters
byteOffset
number
byteLength
number
Returns
ArrayBuffer
size()
size():
number
Defined in: core/model.ts:116
Returns the source byte length as a non-negative integer.
Returns
number