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