テンソルフロー::作戦::どこ3
#include <math_ops.h> conditionに応じて、 xまたはyから要素を選択します。
まとめ
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
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
出力
::tensorflow::Output output
公共機能
どこ3
Where3( const ::tensorflow::Scope & scope, ::tensorflow::Input condition, ::tensorflow::Input x, ::tensorflow::Input y )
ノード
::tensorflow::Node * node() const
演算子::tensorflow::入力
operator::tensorflow::Input() const
演算子::tensorflow::出力
operator::tensorflow::Output() const