chainerx.tri¶
-
chainerx.
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.
- Parameters
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.
device (Device) – Device on which the array is allocated. If omitted, the default device is chosen.
- Returns
A 2-D array with given diagonals filled ones at and below the given diagonal and zeros elsewhere.
- Return type
See also