Classes
List
Internal Instances of theList class are used to represent lists of values in TopK.
Usually created using data constructors such as f32_list(), i32_list(), etc.
SparseVector
Internal Instances of theSparseVector class are used to represent sparse vectors in TopK.
Usually created using data constructors such as f32_sparse_vector() or u8_sparse_vector().
Matrix
Internal Instances of theMatrix class are used to represent matrices in TopK.
Usually created using data constructors such as matrix().
Struct
Internal Instances of theStruct class are used to represent nested object values in TopK.
Usually created using the struct() helper.
Functions
f8_vector()
Returns
List
f16_vector()
Returns
List
f32_vector()
Returns
List
u8_vector()
Returns
List
i8_vector()
Returns
List
binary_vector()
Returns
List
f32_sparse_vector()
Returns
SparseVector
u8_sparse_vector()
Returns
SparseVector
bytes()
Returns
List
u32_list()
Returns
List
i32_list()
Returns
List
i64_list()
Returns
List
f32_list()
Returns
List
f64_list()
Returns
List
string_list()
Returns
List
struct()
Returns
Struct
matrix()
values parameter can be a list of lists or a numpy array. When passing a numpy array,
the matrix type is inferred from the array’s dtype (float32, float16, uint8, int8).
When passing a list of lists, the optional value_type parameter specifies the matrix type.
If value_type is not provided, the matrix defaults to f32.
Returns
Matrix