tril_indices(row: int, col: int | None = None, offset: int = 0, dtype: DTypeLike = None, device: DeviceLike = None)Indices of the lower-triangular part of an (row, col) matrix.
Parameters
rowintNumber of rows in the matrix being indexed.
colint= NoneNumber of columns.
None (default) → col = row
(square matrix).offsetint= 0Diagonal offset.
0 (default) = main diagonal,
positive = include diagonals above it, negative = exclude
diagonals below it. Indexing keeps positions where
j - i <= offset.dtypeDTypeLike= NoneOutput dtype (default: int64).
deviceDeviceLike= NonePlacement of the result.
Returns
TensorShape (2, N). Row 0 holds row indices, row 1 holds
column indices, in row-major order.