Tensorex.Operator.add

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

Specs

Adds two tensors.

iex> Tensorex.Operator.add(
...>   Tensorex.from_list([[0,  1  ,  2  ],
...>                       [3, -4  , -5.5]]),
...>   Tensorex.from_list([[3, -2  , -2  ],
...>                       [6, -8.1, 12  ]]))
%Tensorex{data: %{[0, 0] => 3, [0, 1] =>  -1,
                  [1, 0] => 9, [1, 1] => -12.1, [1, 2] => 6.5}, shape: [2, 3]}

iex> Tensorex.Operator.add(
...>   Tensorex.from_list([[0  ,  1  ,  2  ],
...>                       [3  , -4  , -5.5]]),
...>   Tensorex.from_list([[0.0, -1  , -2  ],
...>                       [6  , -8.1, 12  ]]))
%Tensorex{data: %{[1, 0] => 9, [1, 1] => -12.1, [1, 2] => 6.5}, shape: [2, 3]}

iex> Tensorex.Operator.add(
...>   Tensorex.from_list([[ 0,  6],
...>                       [-3,  0]]),
...>   Tensorex.from_list([[ 8,  0],
...>                       [ 0,  9]]))
%Tensorex{data: %{[0, 0] =>  8, [0, 1] => 6,
                  [1, 0] => -3, [1, 1] => 9}, shape: [2, 2]}