Numy v0.1.1 Numy.Tensor View Source

Numy.Tensor is a multi-dimentional matrix (sometimes caled ND-Array) contaning elements of a single data type.

Link to this section Summary

Functions

Structure Tensor is opaque type for NIF structure.

Callback on module's load. Loads NIF shared library.

Examples

iex(1)> tensor_def = %Numy.Tensor{shape: [2,3]}
#Numy.Tensor<shape: [...], ...>
iex(2)> tensor = Numy.Tensor.create(tensor_def)
#Reference<0.2043608959.3639214083.153022>
iex(3)> Numy.Tensor.nr_dimensions(tensor)
2

Link to this section Types

Link to this section Functions

Structure Tensor is opaque type for NIF structure.

iex> my_tensor = %Numy.Tensor{shape: [3,2]}
Link to this function

create(tensor_struct)

View Source
create(%Numy.Tensor{nif_resource: term(), shape: term()}) :: tensor_res()

Callback on module's load. Loads NIF shared library.

Link to this function

nr_dimensions(tensor)

View Source
nr_dimensions(tensor_res()) :: pos_integer()

Examples

iex(1)> tensor_def = %Numy.Tensor{shape: [2,3]}
#Numy.Tensor<shape: [...], ...>
iex(2)> tensor = Numy.Tensor.create(tensor_def)
#Reference<0.2043608959.3639214083.153022>
iex(3)> Numy.Tensor.nr_dimensions(tensor)
2