tensorflow:: ops:: ParallelDynamicStitch

#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 এর সাপেক্ষে, আউটপুট shape হলো

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