टेंसरफ़्लो:: ऑप्स:: कहा3
#include <math_ops.h> condition के आधार पर x या y से तत्वों का चयन करता है।
सारांश
x , और y टेंसरों का आकार समान होना चाहिए, और आउटपुट का भी वही आकार होगा।
यदि x और y अदिश हैं तो condition टेंसर एक अदिश होना चाहिए। यदि 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
आउटपुट
::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() const
ऑपरेटर::टेन्सरफ़्लो::आउटपुट
operator::tensorflow::Output() const