Tensor.tril()
Returns the lower triangular part of the matrix (2-D tensor) or batch of matrices input, the other elements of the result tensor out are set to 0.
Usage
from tinygrad.tensor import Tensor
a1 = Tensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
a1 = a1.tril()
print(a1.numpy())
Return value
[[1. 0. 0.]
[4. 5. 0.]
[7. 8. 9.]]