View Source Ash.Vector (ash v3.4.43)

A vector struct for Ash.

Implementation based off of https://github.com/pgvector/pgvector-elixir/blob/v0.2.0/lib/pgvector.ex

Summary

Functions

Creates a new vector from its binary representation

Creates a new vector from a list or tensor

Converts the vector to its binary representation

Converts the vector to a list

Types

t()

@type t() :: %Ash.Vector{data: binary()}

Functions

from_binary(binary)

@spec from_binary(binary()) :: t()

Creates a new vector from its binary representation

new(vector)

@spec new(t() | binary() | [integer()]) :: {:ok, t()} | {:error, :invalid_vector}

Creates a new vector from a list or tensor

to_binary(vector)

@spec to_binary(t()) :: binary()

Converts the vector to its binary representation

to_list(vector)

@spec to_list(t()) :: list()

Converts the vector to a list