cupyx.scipy.sparse.triu#

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

Returns the upper triangular portion of a matrix in sparse format

Parameters
  • A (cupy.ndarray or cupyx.scipy.sparse.spmatrix) – Matrix whose upper triangular portion is desired.

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

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

Returns

Upper triangular portion of A in sparse format.

Return type

cupyx.scipy.sparse.spmatrix