זרימת tensor:: ops:: איפה3
#include <math_ops.h> בוחר אלמנטים מתוך x או y , בהתאם condition .
תַקצִיר
טנזורי x ו- y חייבים להיות בעלי צורה זהה, וגם לפלט תהיה צורה זו.
טנזור condition חייב להיות סקלרי אם x ו- y הם סקלרים. אם x ו- y הם וקטורים או בעלי דרגה גבוהה יותר, אז condition חייב להיות סקלרי, וקטור שגודלו תואם את המימד הראשון של x , או שיהיה לו את אותה צורה כמו x .
טנזור condition משמש כמסכה שבוחרת, בהתבסס על הערך בכל אלמנט, האם האלמנט/שורה המתאימים בפלט צריכים להילקח מ- x (אם true) או y (אם false).
אם 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 ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2026-11-05 (שעון UTC).