tensorflow :: ops :: Where3

#include <math_ops.h>

Seleciona elementos de x ou y , dependendo da condition .

Resumo

O x , e y tensores devem ter todos a mesma forma, e a saída terá também que forma.

O tensor de condition deve ser um escalar se x e y forem escalares. Se x e y são vectores ou maior grau, em seguida, condition deve ser um escalar, um vector com o tamanho correspondente a primeira dimensão de x , ou deve ter a mesma forma que x .

O tensor de condition atua como uma máscara que escolhe, com base no valor de cada elemento, se o elemento / linha correspondente na saída deve ser obtido de x (se verdadeiro) ou y (se falso).

Se a condition for um vetor e x e y forem matrizes de classificação superior, ele escolherá qual linha (dimensão externa) copiar de x e y . Se condition tiver a mesma forma de x e y , ela escolherá qual elemento copiar de x e y .

Por exemplo:

# '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]]

  

Arguments:

  • scope: A Scope object
  • x: = A Tensor which may have the same shape as condition. If condition is rank 1, x may have higher rank, but its first dimension must match the size of condition.
  • y: = A Tensor with the same type and shape as x.

Returns:

  • Output: = A Tensor with the same type and shape as x and y.

Constructors and Destructors

Where3(const ::tensorflow::Scope & scope, ::tensorflow::Input condition, ::tensorflow::Input x, ::tensorflow::Input y)

Public attributes

operation
output

Public functions

node() const
::tensorflow::Node *
operator::tensorflow::Input() const
operator::tensorflow::Output() const

Public attributes

operation

Operation operation

resultado

::tensorflow::Output output

Funções públicas

Where3

 Where3(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input condition,
  ::tensorflow::Input x,
  ::tensorflow::Input y
)

::tensorflow::Node * node() const 

operador :: tensorflow :: Input

 operator::tensorflow::Input() const 

operador :: tensorflow :: Saída

 operator::tensorflow::Output() const