# mlx.core.triu — MLX 0.0.7 documentation

Skip to main content
`Ctrl`+`K`

# mlx.core.triu

mlx.core.triu(x: array, k: int, *, stream: Union[ None , Stream , Device ] = None) → array

  Zeros the array below the given diagonal.

  Parameters:

    - x (array) – input array.

    - k (int , optional) – The diagonal of the 2-D array. Defaults to `0`.

    - stream (Stream , optional) – Stream or device. Defaults to `None`.

  Returns:

    Array zeroed below the given diagonal

  Return type:

    array