tensorflow::ops::Where

tensorflow::ops::Where

#include <array_ops.h>

Returns locations of true values in a boolean tensor.

Summary

This operation returns the coordinates of true elements in condition. The coordinates are returned in a 2-D tensor where the first dimension (rows) represents the number of true elements, and the second dimension (columns) represents the coordinates of the true elements. Keep in mind, the shape of the output tensor can vary depending on how many true values there are in condition. Indices are output in row-major order.

For example:

``` 'input' tensor is [[True, False]

[True, False]]

'input' has two true values, so output has two coordinates.

'input' has rank of 2, so coordinates have two indices.

where(input) ==> [[0, 0], [1, 0]]

condition tensor is [[[True, False]

[True, False]]

[[False, True]

[Fals