---
title: "triu"
sidebar_label: "triu"
description: "Kotlin binding reference: triu."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[Ops](index.md)/[triu](triu.md)

# triu

[common]\
fun [triu](triu.md)(input: [Tensor](../Tensor/index.md), diagonal: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [Tensor](../Tensor/index.md)

`triu(input: Tensor, diagonal: Long = 0L)`: the `triu` operator. Zero out the entries BELOW the chosen diagonal of the last two axes; the upper-triangular part survives. `diagonal`: 0 = main, +k above, -k below. Copies.