tensorflow:: אופס:: איפה 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-07-27 (שעון UTC).