tensorflow :: ops :: Where3
#include <math_ops.h>
condition
に応じて、 x
またはy
から要素を選択しcondition
。
概要
x
テンソルとy
テンソルはすべて同じ形状である必要があり、出力もその形状になります。
x
とy
がスカラーの場合、 condition
テンソルはスカラーでなければなりません。場合x
とy
ベクトル又は上位である場合、 condition
スカラー、最初の寸法に一致する寸法を有するベクターのいずれかでなければならx
、または同じ形状持っている必要がありx
。
condition
テンソルは、各要素の値に基づいて、出力の対応する要素/行をx
(trueの場合)またはy
(falseの場合)のどちらから取得するかを選択するマスクとして機能します。
condition
がベクトルで、 x
とy
が上位の行列である場合、 x
とy
からコピーする行(外次元)を選択します。場合condition
同じ形状有しx
及びy
、それはからコピー先の要素を選択したx
およびy
。
例えば:
# '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
出力
::tensorflow::Output output
公の行事
Where3
Where3( const ::tensorflow::Scope & scope, ::tensorflow::Input condition, ::tensorflow::Input x, ::tensorflow::Input y )
ノード
::tensorflow::Node * node() const
operator :: tensorflow :: Input
operator::tensorflow::Input() const
operator :: tensorflow :: Output
operator::tensorflow::Output() const