tri(N, M=None, k=0, dtype=float32, device=None)¶
Returns a 2-D array with ones at and below the given diagonal and zeros elsewhere.
N (int) – Number of rows.
M (int) – Number of columns. M == N by default.
k (int) – Index of the diagonal. Zero indicates the main diagonal, a positive index an upper diagonal, and a negative index a lower diagonal.
dtype – Data type.
A 2-D array with given diagonals filled ones at and below the given diagonal and zeros elsewhere.
- Return type