Optional interoperability with Nx.Tensor values.
Vettore does not use Nx for its vector kernels. This module deliberately resolves Nx at runtime so applications that only use lists or little-endian f32 binaries do not need to install or start Nx.
Add {:nx, "~> 0.11"} to the host application's dependencies when tensor
conversion is required.
Summary
Functions
Returns whether a compatible Nx module is available in the host application.
Creates an f32 Nx tensor, optionally with a shape and host-provided backend.
Returns an Nx tensor's original shape.
Returns whether the value is an Nx tensor without requiring Nx at compile time.
Flattens an Nx tensor into an ordinary Elixir list.
Transfers an Nx tensor to a host-provided backend such as EXLA.
Returns an Nx tensor's element type.
Functions
@spec available?() :: boolean()
Returns whether a compatible Nx module is available in the host application.
@spec from_list( [number()], keyword() ) :: {:ok, term()} | {:error, :invalid_options | :invalid_shape | :invalid_vector | :nx_not_available}
Creates an f32 Nx tensor, optionally with a shape and host-provided backend.
Returns an Nx tensor's original shape.
Returns whether the value is an Nx tensor without requiring Nx at compile time.
Flattens an Nx tensor into an ordinary Elixir list.
Transfers an Nx tensor to a host-provided backend such as EXLA.
Returns an Nx tensor's element type.