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

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

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

# where

[common]\
fun [where](where.md)(condition: [Tensor](../Tensor/index.md), input: [Tensor](../Tensor/index.md), other: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)

`where(condition: Tensor, input: Tensor, other: Tensor)`: the `where` operator. Elementwise select: `condition ? x : y`, with numpy-style broadcasting across all three operands. `condition` is Bool; the output takes the broadcast shape and the promoted common dtype of `input` and `other`.

[common]\
fun [where](where.md)(condition: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)

`where(condition: Tensor)`: the `where` operator. The coordinates where `condition` is nonzero, sugar for `nonzero`. Returns the same `[n, ndim]` Int64 coordinate matrix as ONE tensor (not a per-dim tuple); the row count is data-dependent.