przepływ tensorowy:: ops:: Gdzie3
#include <math_ops.h> Wybiera elementy spośród x lub y , w zależności od condition .
Streszczenie
Wszystkie tensory x i y muszą mieć ten sam kształt i wynik również będzie miał ten kształt.
Tensor condition musi być skalarem, jeśli x i y są skalarami. Jeśli x i y są wektorami lub mają wyższą rangę, wówczas 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 każdego elementu, czy odpowiedni element/wiersz na wyjściu powinien zostać pobrany 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, który wiersz (wymiar zewnętrzny) skopiować z x i y . Jeśli condition ma taki sam kształt jak x i y , wówczas wybiera, który element skopiować 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
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
wyjście
::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::Wejście
operator::tensorflow::Input() const
operator::tensorflow::Wyjście
operator::tensorflow::Output() const