تينسورفلو :: العمليات :: أين 3
#include <math_ops.h>
يختار العناصر من x
أو y
، حسب condition
.
ملخص
يجب أن يكون لكل من موترتي x
و y
نفس الشكل ، وسيكون للمخرجات أيضًا هذا الشكل.
يجب أن يكون موتر condition
عددًا إذا كان x
و y
عدديين. إذا كانت 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 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
الوظائف العامة
أين 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 :: Output
operator::tensorflow::Output() const
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-04-20 UTC.