Tensorex.diagonal-question-mark

You're seeing just the function diagonal-question-mark, go back to Tensorex module for more information.

Specs

diagonal?(t()) :: boolean()

Checks if the given tensor is diagonal or not.

iex> Tensorex.diagonal?(Tensorex.from_list([[2, 0,  0],
...>                                        [0, 3,  0],
...>                                        [0, 0, -9]]))
true

iex> Tensorex.diagonal?(Tensorex.from_list([[ 2  , 0,  0],
...>                                        [ 0  , 3,  0],
...>                                        [-5.3, 0, -9]]))
false