टेन्सरफ्लो::ऑप्स::पैरेललडायनेमिकस्टिच
#include <data_flow_ops.h> data टेंसरों के मानों को एक ही टेंसर में मिश्रित करें।
सारांश
एक मर्ज किए गए टेंसर का निर्माण करता है जैसे कि
merged[indices[m][i, ..., j], ...] = data[m][i, ..., j, ...]
उदाहरण के लिए, यदि प्रत्येक indices[m] अदिश या सदिश है, तो हमारे पास है
# Scalar indices: merged[indices[m], ...] = data[m][...]
# Vector indices: merged[indices[m][i], ...] = data[m][i, ...]
प्रत्येक data[i].shape शुरुआत संबंधित indices[i].shape से होनी चाहिए, और data[i].shape का शेष भाग i के सापेक्ष स्थिर होना चाहिए। यानी, data[i].shape = indices[i].shape + constant होना चाहिए। इस constant के संदर्भ में, आउटपुट आकार इस प्रकार है:
merged.shape = [max(indices)] + constant
मानों को समानांतर रूप से मर्ज किया जा सकता है, इसलिए यदि कोई इंडेक्स indices[m][i] और indices[n][j] दोनों में मौजूद है, तो परिणाम अमान्य हो सकता है। यह सामान्य DynamicStitch ऑपरेटर से भिन्न है जो उस स्थिति में व्यवहार को परिभाषित करता है।
उदाहरण के लिए:
indices[0] = 6
indices[1] = [4, 1]
indices[2] = [[5, 2], [0, 3]]
data[0] = [61, 62]
data[1] = [[41, 42], [11, 12]]
data[2] = [[[51, 52], [21, 22]], [[1, 2], [31, 32]]]
merged = [[1, 2], [11, 12], [21, 22], [31, 32], [41, 42],
[51, 52], [61, 62]] इस विधि का उपयोग dynamic_partition द्वारा बनाए गए विभाजनों को मर्ज करने के लिए किया जा सकता है, जैसा कि निम्नलिखित उदाहरण में दिखाया गया है:
# Apply function (increments x_i) on elements for which a certain condition # apply (x_i != -1 in this example). x=tf.constant([0.1, -1., 5.2, 4.3, -1., 7.4]) condition_mask=tf.not_equal(x,tf.constant(-1.)) partitioned_data = tf.dynamic_partition( x, tf.cast(condition_mask, tf.int32) , 2) partitioned_data[1] = partitioned_data[1] + 1.0 condition_indices = tf.dynamic_partition( tf.range(tf.shape(x)[0]), tf.cast(condition_mask, tf.int32) , 2) x = tf.dynamic_stitch(condition_indices, partitioned_data) # Here x=[1.1, -1., 6.2, 5.3, -1, 8.4], the -1. values remain # unchanged.

तर्क:
- स्कोप: एक स्कोप ऑब्जेक्ट
प्रतिफल:
-
Output: मर्ज किया गया टेंसर।
कंस्ट्रक्टर और डिस्ट्रक्टर | |
|---|---|
ParallelDynamicStitch (const :: tensorflow::Scope & scope, :: tensorflow::InputList indices, :: tensorflow::InputList data) |
सार्वजनिक विशेषताएँ | |
|---|---|
merged | |
operation | |
सार्वजनिक समारोह | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
सार्वजनिक विशेषताएँ
विलय होना
::tensorflow::Output merged
संचालन
Operation operation
सार्वजनिक समारोह
पैरेललडायनामिकस्टिच
ParallelDynamicStitch( const ::tensorflow::Scope & scope, ::tensorflow::InputList indices, ::tensorflow::InputList data )
नोड
::tensorflow::Node * node() const
ऑपरेटर::टेन्सरफ्लो::इनपुट
operator::tensorflow::Input() const
ऑपरेटर::टेन्सरफ्लो::आउटपुट
operator::tensorflow::Output() const