टेन्सरफ्लो::ऑप्स::वेयर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