tensor akışı:: işlem:: Nerede3
#include <math_ops.h> condition bağlı olarak x veya y arasından öğeleri seçer.
Özet
x ve y tensörlerinin tümü aynı şekle sahip olmalıdır ve çıktı da bu şekle sahip olacaktır.
x ve y skaler ise condition tensörü skaler olmalıdır. Eğer x ve y vektörler veya daha yüksek dereceliyse, condition ya bir skaler olmalı, boyutu x ilk boyutuyla eşleşen bir vektör olmalı ya da x ile aynı şekle sahip olmalıdır.
condition tensörü, her öğedeki değere bağlı olarak, çıktıdaki karşılık gelen öğenin/satırın x (doğruysa) veya y (yanlışsa) alınması gerektiğini seçen bir maske görevi görür.
condition bir vektörse ve x ile y daha yüksek dereceli matrislerse, x ve y hangi satırın (dış boyut) kopyalanacağını seçer. condition x ve y ile aynı şekle sahipse, x ve y hangi öğenin kopyalanacağını seçer.
Örneğin:
# '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
çıktı
::tensorflow::Output output
Kamu işlevleri
Nerede3
Where3( const ::tensorflow::Scope & scope, ::tensorflow::Input condition, ::tensorflow::Input x, ::tensorflow::Input y )
düğüm
::tensorflow::Node * node() const
operatör::tensorflow::Giriş
operator::tensorflow::Input() const
operatör::tensorflow::Çıktı
operator::tensorflow::Output() const