tensoreflusso:: ops:: Dove3
#include <math_ops.h> Seleziona gli elementi da x y , a seconda della condition .
Riepilogo
I tensori x e y devono avere tutti la stessa forma e anche l'output avrà quella forma.
Il tensore condition deve essere scalare se x y scalari. Se x e y sono vettori o di rango superiore, condition deve essere uno scalare, un vettore con dimensioni corrispondenti alla prima dimensione di x oppure deve avere la stessa forma di x .
Il tensore condition agisce come una maschera che sceglie, in base al valore di ciascun elemento, se l'elemento/riga corrispondente nell'output deve essere preso da x (se vero) o y (se falso).
Se condition è un vettore e x sono matrici y rango superiore, sceglie quale riga (dimensione esterna) copiare y x . Se condition ha la stessa forma di x e y , sceglie quale elemento copiare da x e y .
Per esempio:
# '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
Tensorwhich may have the same shape ascondition. Ifconditionis rank 1,xmay have higher rank, but its first dimension must match the size ofcondition. - y: = A
Tensorwith the same type and shape asx.
Returns:
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
produzione
::tensorflow::Output output
Funzioni pubbliche
Dove3
Where3( const ::tensorflow::Scope & scope, ::tensorflow::Input condition, ::tensorflow::Input x, ::tensorflow::Input y )
nodo
::tensorflow::Node * node() const
operatore::tensorflow::Input
operator::tensorflow::Input() const
operatore::tensorflow::Output
operator::tensorflow::Output() const