where

Function Description

Returns the elements of x or y based on conditions.

Prototype

1
2
3
where(
    condition, x, y, name=None
)

Usage

The usage is the same as that of the native TensorFlow where operator. If condition is of the bool type and x and y are of a specific type (tf.int64), the operator optimized by SVE is executed. For other types of input parameters, the native where operator is executed.

For details about the installation method, see cust_op/tf_cpu_op/README.md in the Rec SDK TensorFlow source code.

Restrictions

  • Only 1D tensor input parameters are supported.
  • x and y must have the same input type.
  • The lengths of condition, x, and y must be the same.