جریان تنسور:: عملیات:: کجا 3
#include <math_ops.h>
بسته به condition
، عناصر را از x
یا y
انتخاب می کند.
خلاصه
تانسورهای x
و y
همگی باید یک شکل باشند و خروجی نیز آن شکل را خواهد داشت.
اگر x
و y
اسکالر باشند، تانسور condition
باید یک اسکالر باشد. اگر x
و y
بردار یا رتبه بالاتری باشند، آنگاه condition
باید یا یک اسکالر باشد، یا بردار با اندازه ای که با بعد اول x
مطابقت داشته باشد، یا باید همان شکل x
باشد.
تانسور condition
به عنوان یک ماسک عمل می کند که بر اساس مقدار هر عنصر انتخاب می کند که آیا عنصر / ردیف مربوطه در خروجی باید از x
(در صورت درست) یا y
(اگر نادرست) گرفته شود.
اگر 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 functions |
|
---|---|
node() const
|
::tensorflow::Node *
|
operator::tensorflow::Input() const
|
|
operator::tensorflow::Output() const
|
|
Public attributes
operation
Operation operation
خروجی
::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