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

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

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

# nonzero

[common]\
fun [nonzero](nonzero.md)(input: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)

`nonzero(input: Tensor)`: the `nonzero` operator. Coordinates of the nonzero elements: an `[n, ndim]` Int64 matrix, one row per nonzero element of `input`. An element is nonzero exactly when its Bool cast is true: +0 and -0 are zero; a subnormal, an infinity and a NaN are nonzero. The row count is data-dependent (see `masked_select`); a 1-arg `where()` call is sugar for this op.