SafetensorsFile class final

Constructors

SafetensorsFile.open(String path)
factory

Properties

dataStart → int
File offset of the data section; tensor offsets are relative to it.
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tensors → Map<String, TensorInfo>
final

Methods

close() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readBf16Bits(String name, List<int> shape) → Uint16List
Reads a BF16 tensor as its raw 16-bit patterns, half the size of readF32; widening a pattern p to float32 is p << 16.
readF32(String name, List<int> shape, {int rowStart = 0, int? rowEnd}) → Float32List
Reads a tensor as float32, checking its shape. BF16 widens exactly: a bfloat16 is the top half of the float32 with the same value.
toString() → String
A string representation of this object.
inherited
writeSubset(String path, bool keep(String name, TensorInfo info), {String rename(String name)?}) → void
Writes the tensors for which keep holds to a new safetensors file at path, bytes unchanged and in this file's order. rename changes header names only; duplicate output names are rejected before writing.

Operators

operator ==(Object other) → bool
The equality operator.
inherited