aesara.tensor.triu_indices

Contents

aesara.tensor.triu_indices#

aesara.tensor.triu_indices(n: int | ScalarVariable, k: int | ScalarVariable = 0, m: int | ScalarVariable | None = None) Tuple[TensorVariable, TensorVariable][source]#

Return the indices for the upper-triangle of an (n, m) array.

Parameters:
  • n (integer scalar) – The row dimension of the arrays for which the returned indices will be valid.

  • k (integer scalar, optional) – Diagonal offset to use when forming the indices. k = 0 (the default) is the main diagonal, k < 0 is below it and k > 0 is above.

  • m (int scalar, optional) – The column dimension of the arrays for which the returned arrays will be valid. By default m is taken equal to n.

Returns:

inds – The indices for the triangle. The returned tuple contains two arrays, each with the indices along one dimension of the array.

Return type:

tuple of TensorVariable’s