Selects elements from
y, depending on
Compat aliases for migration
See Migration guide for more details.
tf.raw_ops.Select( condition, x, y, name=None )
y tensors must all have the same shape, and the
output will also have that shape.
condition tensor must be a scalar if
y are scalars.
y are vectors or higher rank, then
condition must be either a
scalar, a vector with size matching the first dimension of
x, or must have
the same shape as
condition tensor acts as a mask that chooses, based on the value at each
element, whether the corresponding element / row in the output should be
x (if true) or
y (if false).
condition is a vector and
y are higher rank matrices, then
it chooses which row (outer dimension) to copy from
condition has the same shape as
y, then it chooses which
element to copy from
# 'condition' tensor is [[True, False] # [False, True]] # 't' is [[1, 2], # [3, 4]] # 'e' is [[5, 6], # [7, 8]] select(condition, t, e) # => [[1, 6], [7, 4]] # 'condition' tensor is [True, False] # 't' is [[1, 2], # [3, 4]] # 'e' is [[5, 6], # [7, 8]] select(condition, t, e) ==> [[1, 2], [7, 8]]
Tensorwhich may have the same shape as
conditionis rank 1,
xmay have higher rank, but its first dimension must match the size of
Tensorwith the same type and shape as
name: A name for the operation (optional).
Tensor. Has the same type as