Documentation
¶
Index ¶
- Variables
- type File
- func (f *File) Close() error
- func (f *File) KeyValue(key string) KeyValue
- func (f *File) KeyValues() iter.Seq2[int, KeyValue]
- func (f *File) NumKeyValues() int
- func (f *File) NumTensors() int
- func (f *File) TensorInfo(name string) TensorInfo
- func (f *File) TensorInfos() iter.Seq2[int, TensorInfo]
- func (f *File) TensorReader(name string) (TensorInfo, io.Reader, error)
- type KeyValue
- type TensorInfo
- type TensorType
- type Value
- func (v Value) Bool() bool
- func (v Value) Bools() (bools []bool)
- func (v Value) Float() float64
- func (v Value) Floats() (f64s []float64)
- func (v Value) Int() int64
- func (v Value) Ints() (i64s []int64)
- func (v Value) String() string
- func (v Value) Strings() (strings []string)
- func (v Value) Uint() uint64
- func (v Value) Uints() (u64s []uint64)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnsupported = errors.New("unsupported")
Functions ¶
This section is empty.
Types ¶
type File ¶
func (*File) NumKeyValues ¶
func (*File) NumTensors ¶
func (*File) TensorInfo ¶
func (f *File) TensorInfo(name string) TensorInfo
func (*File) TensorInfos ¶
func (f *File) TensorInfos() iter.Seq2[int, TensorInfo]
func (*File) TensorReader ¶
type TensorInfo ¶
type TensorInfo struct {
Name string
Offset uint64
Shape []uint64
Type TensorType
}
func (TensorInfo) LogValue ¶
func (ti TensorInfo) LogValue() slog.Value
func (TensorInfo) NumBytes ¶
func (ti TensorInfo) NumBytes() int64
NumBytes returns the number of bytes in the tensor.
func (TensorInfo) NumValues ¶
func (ti TensorInfo) NumValues() int64
func (TensorInfo) Valid ¶
func (ti TensorInfo) Valid() bool
type TensorType ¶
type TensorType uint32
const ( TensorTypeF32 TensorType = iota TensorTypeF16 TensorTypeQ4_0 TensorTypeQ4_1 TensorTypeQ5_0 TensorTypeQ5_1 TensorTypeQ8_0 TensorTypeQ8_1 TensorTypeQ2_K TensorTypeQ3_K TensorTypeQ4_K TensorTypeQ5_K TensorTypeQ6_K TensorTypeQ8_K TensorTypeI8 TensorTypeI16 TensorTypeI32 TensorTypeI64 TensorTypeF64 TensorTypeBF16 )
func (TensorType) LogValue ¶
func (tt TensorType) LogValue() slog.Value
func (TensorType) NumBytes ¶
func (tt TensorType) NumBytes() float64
func (TensorType) String ¶
func (tt TensorType) String() string
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
func (Value) Bools ¶
Bools returns Value as a boolean slice. If it is not a boolean slice, it returns nil.
func (Value) Floats ¶
Floats returns Value as a float slice. If it is not a float slice, it returns nil.
func (Value) Int ¶
Int returns Value as a signed integer. If it is not a signed integer, it returns 0.
func (Value) Ints ¶
Ints returns Value as a signed integer slice. If it is not a signed integer slice, it returns nil.
func (Value) String ¶
String returns Value as a string. If it is not a string, it returns an empty string.
func (Value) Strings ¶
Strings returns Value as a string slice. If it is not a string slice, it returns nil.
Click to show internal directories.
Click to hide internal directories.