Python wrappers
Public Python APIs implemented by this engine symbol.Lower-triangular part of a matrix (or batch of matrices).
Zeros every element strictly above the k-th diagonal of the last
two axes of a. The main diagonal is k = 0; positive k
shifts the diagonal toward the upper-right (keeping more elements);
negative k toward the lower-left (keeping fewer).
Math
a_{\ldots,i,j} & \text{if } j - i \le k \\ 0 & \text{otherwise} \end{cases}$$ **See Also** triu_op : Upper-triangular counterpart.Parameters
aTensorImplPtrInput tensor of rank . The mask is applied to the trailing two axes; leading axes are treated as batch dimensions.
kintDiagonal offset. Default 0 (main diagonal).
Returns
TensorImplPtrTensor of the same shape and dtype as a with the upper triangle (relative to k) zeroed.
Notes
Backward applies tril with the same k to the incoming gradient,
preserving only the gradient at positions retained in the forward pass.