Skip to main content
topk-js / data

Functions

binaryVector()

Creates a List type containing a binary vector. This function is an alias for binaryList(). Example:
Parameters Returns List

bytes()

Creates a List type containing bytes data. Example:
Parameters Returns Buffer

f16Vector()

Creates a List type containing a 16-bit float vector. Example:
Parameters Returns List

f32List()

Creates a List type containing a list of 32-bit floating point numbers. Example:
Parameters Returns List

f32SparseVector()

Creates a SparseVector type containing a sparse vector of 32-bit floats. This function is an alias for f32SparseList(). Example:
Parameters Returns SparseVector

f32Vector()

Creates a List type containing a 32-bit float vector. This function is an alias for f32List(). Example:
Parameters Returns List

f64List()

Creates a List type containing a list of 64-bit floating point numbers. Example:
Parameters Returns List

f8Vector()

Creates a List type containing an 8-bit float vector. Example:
Parameters Returns List

i32List()

Creates a List type containing a list of 32-bit signed integers. Example:
Parameters Returns List

i64List()

Creates a List type containing a list of 64-bit signed integers. Example:
Parameters Returns List

i8Vector()

Creates a List type containing an 8-bit signed integer vector. This function is an alias for i8List(). Example:
Parameters Returns List

matrix()

Create a Matrix type containing matrix values. The 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.
Parameters Returns Matrix

stringList()

Creates a List type containing a list of strings. Example:
Parameters Returns List

struct()

Creates a Struct type containing nested object values. Example:
Parameters Returns Struct

u32List()

Creates a List type containing a list of 32-bit unsigned integers. Example:
Parameters Returns List

u8SparseVector()

Creates a SparseVector type containing a sparse vector of 8-bit unsigned integers. This function is an alias for u8SparseList(). Example:
Parameters Returns SparseVector

u8Vector()

Creates a List type containing an 8-bit unsigned integer vector. This function is an alias for u8List(). Example:
Parameters Returns 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.

UnknownValue

Internal Placeholder for a value this version of the SDK cannot represent.

Type Aliases

MatrixValueType

Matrix element value type.