cupy.triu_indices_from#

cupy.triu_indices_from(arr, k=0)[source]#

Returns indices for the upper-triangle of arr.

Parameters
  • arr (cupy.ndarray) – The indices are valid for square arrays.

  • k (int, optional) – Diagonal offset (see β€˜triu_indices` for details).

Returns

triu_indices_from – Indices for the upper-triangle of arr.

Return type

tuple of ndarrays