Tensorex.fill

You're seeing just the function fill, go back to Tensorex module for more information.

Specs

fill([pos_integer(), ...], number()) :: t()

Returns a tensor where all of elements are the given value.

iex> Tensorex.fill([3, 4, 2], 2)
%Tensorex{data: %{[0, 0, 0] => 2, [0, 0, 1] => 2,
                  [0, 1, 0] => 2, [0, 1, 1] => 2,
                  [0, 2, 0] => 2, [0, 2, 1] => 2,
                  [0, 3, 0] => 2, [0, 3, 1] => 2,
                  [1, 0, 0] => 2, [1, 0, 1] => 2,
                  [1, 1, 0] => 2, [1, 1, 1] => 2,
                  [1, 2, 0] => 2, [1, 2, 1] => 2,
                  [1, 3, 0] => 2, [1, 3, 1] => 2,
                  [2, 0, 0] => 2, [2, 0, 1] => 2,
                  [2, 1, 0] => 2, [2, 1, 1] => 2,
                  [2, 2, 0] => 2, [2, 2, 1] => 2,
                  [2, 3, 0] => 2, [2, 3, 1] => 2}, shape: [3, 4, 2]}

iex> Tensorex.fill([2, 2, 5], 0.0)
%Tensorex{data: %{}, shape: [2, 2, 5]}