cupyx.scipy.sparse.triu#

cupyx.scipy.sparse.triu(A, k=0, format=None)[source]#

Return the upper triangular portion of a sparse object.

Parameters:
  • A (cupy.ndarray or cupyx.scipy.sparse) – Input array/matrix.

  • k (integer) – The bottom-most diagonal of the upper triangle.

  • format (string) – Sparse format of the result, e.g. 'csr', 'csc'.

Returns:

Upper triangular portion of A. Returns a sparse array when A is a sparse array, else a sparse matrix.

Return type:

cupyx.scipy.sparse