cupyx.scipy.linalg.triu(m, k=0)[source]

Make a copy of a matrix with elements below the k-th diagonal zeroed.

  • m (cupy.ndarray) – Matrix whose elements to return

  • k (int, optional) – Diagonal above which to zero elements. k == 0 is the main diagonal, k < 0 subdiagonal and k > 0 superdiagonal.


Return matrix with zeroed elements below the kth diagonal and has same shape and type as m.

Return type