cupy.tri#

cupy.tri(N, M=None, k=0, dtype=<class 'float'>)[source]#

Creates an array with ones at and below the given diagonal.

Parameters:
  • N (int) – Number of rows.

  • M (int) – Number of columns. M == N by default.

  • k (int) – The sub-diagonal at and below which the array is filled. Zero is the main diagonal, a positive value is above it, and a negative value is below.

  • dtype – Data type specifier.

Returns:

An array with ones at and below the given diagonal.

Return type:

cupy.ndarray

See also

numpy.tri()