dpctl.tensor.tril

dpctl.tensor.tril(x, /, *, k=0)[source]

Returns the lower triangular part of a matrix (or a stack of matrices) x.

The lower triangular part of the matrix is defined as the elements on and below the specified diagonal k.

Parameters:
  • x (usm_ndarray) – Input array

  • k (int, optional) – Specifies the diagonal above which to set elements to zero. If k = 0, the diagonal is the main diagonal. If k < 0, the diagonal is below the main diagonal. If k > 0, the diagonal is above the main diagonal. Default: 0

Returns:

A lower-triangular array or a stack of lower-triangular arrays.

Return type:

usm_ndarray