Functions
binaryVector()
| Parameter | Type |
|---|---|
values | number[] |
List
bytes()
| Parameter | Type |
|---|---|
buffer | number[] | Buffer<ArrayBufferLike> |
Buffer
f16Vector()
| Parameter | Type |
|---|---|
values | number[] |
List
f32List()
| Parameter | Type |
|---|---|
values | number[] |
List
f32SparseVector()
| Parameter | Type |
|---|---|
vector | Record<number, number> |
SparseVector
f32Vector()
| Parameter | Type |
|---|---|
values | number[] |
List
f64List()
| Parameter | Type |
|---|---|
values | number[] |
List
f8Vector()
| Parameter | Type |
|---|---|
values | number[] |
List
i32List()
| Parameter | Type |
|---|---|
values | number[] |
List
i64List()
| Parameter | Type |
|---|---|
values | number[] |
List
i8Vector()
| Parameter | Type |
|---|---|
values | number[] |
List
matrix()
values parameter must be an array of number arrays. When passing an array of number arrays,
the optional valueType parameter specifies the matrix type.
If valueType is not provided, the matrix defaults to f32.
| Parameter | Type |
|---|---|
values | number[][] |
valueType? | MatrixValueType |
Matrix
stringList()
| Parameter | Type |
|---|---|
values | string[] |
List
struct()
| Parameter | Type |
|---|---|
fields | Record<string, any> |
Struct
u32List()
| Parameter | Type |
|---|---|
values | number[] |
List
u8SparseVector()
| Parameter | Type |
|---|---|
vector | Record<number, number> |
SparseVector
u8Vector()
| Parameter | Type |
|---|---|
values | number[] |
List
Classes
List
Internal
Instances of the List class are used to represent lists of values in TopK.
Usually created using data constructors such as f32_list(), i32_list(), etc.
Matrix
Internal
Instances of the Matrix class are used to represent matrices in TopK.
Usually created using data constructors such as matrix().
SparseVector
Internal
Instances of the SparseVector class are used to represent sparse vectors in TopK.
Usually created using data constructors such as f32_sparse_vector() or u8_sparse_vector().
Struct
Internal
Instances of the Struct class are used to represent nested object values in TopK.
Usually created using the struct() helper.