Search documentation of ash

# Ash.Vector (ash v3.4.71)

View Source

A vector struct for Ash.

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

# Summary

## Types

t()

## Functions

from_binary(binary)

Creates a new vector from its binary representation

new(vector)

Creates a new vector from a list or tensor

to_binary(vector)

Converts the vector to its binary representation

to_list(vector)

Converts the vector to a list

# Types

# t()

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

# 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