tensorflow :: ops :: Gdzie3
#include <math_ops.h>
Wybiera elementy z x
lub y
, w zależności od condition
.
streszczenie
Wszystkie tensory x
i y
muszą mieć ten sam kształt, a dane wyjściowe również będą miały ten kształt.
Tensor condition
musi być skalarem, jeśli x
i y
są skalarami. Jeśli x
i y
są wektorami lub wyższą rangą, to condition
musi być skalarem, wektorem o rozmiarze pasującym do pierwszego wymiaru x
lub musi mieć taki sam kształt jak x
.
Tensor condition
działa jak maska, która wybiera, na podstawie wartości w każdym elemencie, czy odpowiedni element / wiersz w wyjściu powinien pochodzić z x
(jeśli prawda), czy y
(jeśli fałsz).
Jeśli condition
jest wektorem, a x
i y
są macierzami wyższego rzędu, wówczas wybiera wiersz (wymiar zewnętrzny) do skopiowania z x
i y
. Jeśli condition
ma taki sam kształt jak x
i y
, wybiera element do skopiowania z x
i y
.
Na przykład:
# '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 ascondition
. Ifcondition
is rank 1,x
may have higher rank, but its first dimension must match the size ofcondition
. - y: = A
Tensor
with 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
operation
Operation operation
wynik
::tensorflow::Output output
Funkcje publiczne
Gdzie3
Where3( const ::tensorflow::Scope & scope, ::tensorflow::Input condition, ::tensorflow::Input x, ::tensorflow::Input y )
węzeł
::tensorflow::Node * node() const
operator :: tensorflow :: Input
operator::tensorflow::Input() const
operator :: tensorflow :: Output
operator::tensorflow::Output() const