# `Ash.Vector`
[🔗](https://github.com/ash-project/ash/blob/v3.27.8/lib/ash/vector.ex#L5)

A vector struct for Ash.

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

# `t`

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

# `from_binary`

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

Creates a new vector from its binary representation

# `new`

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

Creates a new vector from a list or tensor

# `to_binary`

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

Converts the vector to its binary representation

# `to_list`

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

Converts the vector to a list

---

*Consult [api-reference.md](api-reference.md) for complete listing*
