Google I/O में ट्यूनिंग के लिए धन्यवाद। मांग पर सभी सत्र देखें मांग पर देखें

टेंसरफ़्लो :: ऑप्स :: कहाँ ३

#include <math_ops.h>

condition आधार पर, x या y से तत्वों का चयन करता है।

सारांश

x , और y टेंसरों में सभी का आकार एक जैसा होना चाहिए, और आउटपुट का भी आकार होगा।

condition टेन्सर अगर एक अदिश होना चाहिए x और y scalars हैं। यदि 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 Tensor which may have the same shape as condition. If condition is rank 1, x may have higher rank, but its first dimension must match the size of condition.
  • y: = A Tensor with the same type and shape as x.

Returns:

  • Output: = A Tensor with the same type and shape as x and y.

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

सार्वजनिक कार्य

कहाँ ३

 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