tensorflow :: অপস:: SparseSegmentSumWithNumSegments

#include <math_ops.h>

একটি টেনসরের স্পার্স সেগমেন্টের সাথে যোগফল গণনা করে।

সারসংক্ষেপ

SparseSegmentSum এর মত, কিন্তু segment_ids এ অনুপস্থিত আইডি অনুমোদন করে। যদি একটি আইডি অনুপস্থিত থাকে, তাহলে সেই অবস্থানে output টেনসর শূন্য হবে।

সেগমেন্টের ব্যাখ্যার জন্য বিভাজন সংক্রান্ত বিভাগটি পড়ুন।

উদাহরণ স্বরূপ:

c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])

tf.sparse_segment_sum_with_num_segments(
    c, tf.constant([0, 1]), tf.constant([0, 0]), num_segments=3)
# => [[0 0 0 0]
#     [0 0 0 0]
#     [0 0 0 0]]

tf.sparse_segment_sum_with_num_segments(c,
                                        tf.constant([0, 1]),
                                        tf.constant([0, 2],
                                        num_segments=4))
# => [[ 1  2  3  4]
#     [ 0  0  0  0]
#     [-1 -2 -3 -4]
#     [ 0  0  0  0]]

যুক্তি:

  • স্কোপ: একটি স্কোপ অবজেক্ট
  • সূচক: একটি 1-ডি টেনসর। segment_ids এর মতো একই র‍্যাঙ্ক আছে।
  • segment_ids: একটি 1-D টেনসর। মানগুলি সাজানো উচিত এবং পুনরাবৃত্তি করা যেতে পারে।
  • সংখ্যা_সেগমেন্ট: স্বতন্ত্র সেগমেন্ট আইডির সংখ্যার সমান হওয়া উচিত।

রিটার্ন:

  • Output : ডাটার মতো একই আকৃতি আছে, মাত্র 0 ব্যতীত যার আকার num_segments আছে।

কনস্ট্রাক্টর এবং ডেস্ট্রাক্টর

SparseSegmentSumWithNumSegments (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: tensorflow::Input indices, :: tensorflow::Input segment_ids, :: tensorflow::Input num_segments)

পাবলিক বৈশিষ্ট্য

operation
output

পাবলিক ফাংশন

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

পাবলিক বৈশিষ্ট্য

অপারেশন

Operation operation

আউটপুট

::tensorflow::Output output

পাবলিক ফাংশন

SparseSegmentSumWithNumSegments

 SparseSegmentSumWithNumSegments(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input data,
  ::tensorflow::Input indices,
  ::tensorflow::Input segment_ids,
  ::tensorflow::Input num_segments
)

নোড

::tensorflow::Node * node() const 

অপারেটর::টেনসরফ্লো::ইনপুট

 operator::tensorflow::Input() const 

অপারেটর::টেনসরফ্লো::আউটপুট

 operator::tensorflow::Output() const