Tensorex.pop

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

Specs

pop(t(), [integer() | Range.t(), ...]) :: {t() | number(), t()}

Pops the tensor or the number stored at the index out of the tensor.

iex> pop_in(
...>   Tensorex.from_list([[[ 1   ,   -3.1,   2  ],
...>                        [ 4   ,    5  ,  -6.1],
...>                        [ 0.9 ,  -91.2,  11  ]],
...>                       [[10   ,  -30.1,  20  ],
...>                        [40   ,   50  , -60.1],
...>                        [ 0.09, -910.2, 110  ]]])[[0]])
{%Tensorex{data: %{[0, 0] => 1,   [0, 1] => -3.1 , [0, 2] =>  2  ,
                   [1, 0] => 4,   [1, 1] =>  5   , [1, 2] => -6.1,
                   [2, 0] => 0.9, [2, 1] => -91.2, [2, 2] => 11  }, shape: [3, 3]},
 %Tensorex{data: %{[1, 0, 0] => 10   , [1, 0, 1] =>  -30.1, [1, 0, 2] =>  20  ,
                   [1, 1, 0] => 40   , [1, 1, 1] =>   50  , [1, 1, 2] => -60.1,
                   [1, 2, 0] =>  0.09, [1, 2, 1] => -910.2, [1, 2, 2] => 110  }, shape: [2, 3, 3]}}

iex> pop_in(
...>   Tensorex.from_list([[[ 1   ,   -3.1,   2  ],
...>                        [ 4   ,    5  ,  -6.1],
...>                        [ 0.9 ,  -91.2,  11  ]],
...>                       [[10   ,  -30.1,  20  ],
...>                        [40   ,   50  , -60.1],
...>                        [ 0.09, -910.2, 110  ]]])[[0, 1, 2]])
{-6.1, %Tensorex{data: %{[0, 0, 0] =>  1   , [0, 0, 1] =>   -3.1, [0, 0, 2] =>   2  ,
                         [0, 1, 0] =>  4   , [0, 1, 1] =>    5  ,
                         [0, 2, 0] =>  0.9 , [0, 2, 1] =>  -91.2, [0, 2, 2] =>  11  ,
                         [1, 0, 0] => 10   , [1, 0, 1] =>  -30.1, [1, 0, 2] =>  20  ,
                         [1, 1, 0] => 40   , [1, 1, 1] =>   50  , [1, 1, 2] => -60.1,
                         [1, 2, 0] =>  0.09, [1, 2, 1] => -910.2, [1, 2, 2] => 110  }, shape: [2, 3, 3]}}