Pgvector.SparseVector (pgvector v0.3.1)

View Source

A sparse vector struct for pgvector

Summary

Functions

Returns the number of dimensions

Creates a new sparse vector from its binary representation

Returns the non-zero indices

Creates a new sparse vector from a list, tensor or sparse vector

Creates a new sparse vector from a map of non-zero elements

Returns the non-zero values

Functions

dimensions(vector)

Returns the number of dimensions

from_binary(binary)

Creates a new sparse vector from its binary representation

indices(vector)

Returns the non-zero indices

new(list)

Creates a new sparse vector from a list, tensor or sparse vector

new(map, dimensions)

Creates a new sparse vector from a map of non-zero elements

values(vector)

Returns the non-zero values