Function dfdx::tensor_ops::upper_tri

source ·
pub fn upper_tri<S: Shape, E: Dtype, D: TriangleTensor<E>, T: Tape<E, D>>(
    t: Tensor<S, E, D, T>,
    diagonal: impl Into<Option<isize>>
) -> Tensor<S, E, D, T>where
    Tensor<S, E, D, T>: TryMul<Tensor<S, E, D>> + HasErr<Err = D::Err>,
Expand description

Applies a 2D upper triangular mask by setting values below the diagonal to E::default().

See TriangleTensor::upper_tri.