تدفق التوتر:: العمليات:: أين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 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
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
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-10-20 (حسب التوقيت العالمي المتفَّق عليه)