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.
Image
Instances of theImage class are used to represent images in TopK.
Created using the image() helper and returned for image fields by get().
Image fields can’t be selected in queries, use get() with the _ids returned from a query instead.
Images read from TopK can be written back as-is without re-encoding.
Example:
Methods
to_pil()
pip install pillow).
Returns
PIL.Image.Image
UnknownValue
Internal Placeholder for a value this version of the SDK cannot represent.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
image()
to_pil() to decode them.
Example:
Returns
Image