সেন্সরফ্লো :: অপস :: স্পারসেসমেন্টমেন্টসাম
#include <math_ops.h>
একটি টেনসর এর বিরল অংশে যোগফলকে গণনা করে।
সারসংক্ষেপ
বিভাগগুলির ব্যাখ্যার জন্য বিভাগগুলিতে বিভাগটি পড়ুন।
SegmentSum
মতো, তবে segment_ids
indices
দ্বারা নির্দিষ্ট 0 মাত্রার একটি উপসেট নির্বাচন করে, data
প্রথম মাত্রার চেয়ে কম র্যাঙ্ক segment_ids
পারে।
উদাহরণ স্বরূপ:
c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])
# Select two rows, one segment. tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 0])) # => [[0 0 0 0]]
# Select two rows, two segment. tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 1])) # => [[ 1 2 3 4] # [-1 -2 -3 -4]]
# Select all rows, two segments. tf.sparse_segment_sum(c, tf.constant([0, 1, 2]), tf.constant([0, 0, 1])) # => [[0 0 0 0] # [5 6 7 8]]
# Which is equivalent to: tf.segment_sum(c, tf.constant([0, 0, 1]))
যুক্তি:
- সুযোগ: একটি স্কোপ অবজেক্ট
- সূচকগুলি: একটি 1-ডি টেনসর।
segment_ids
সমান র্যাঙ্কsegment_ids
। - সেগমেন্ট_আইডস: একটি 1-ডি টেন্সর। মানগুলি বাছাই করা উচিত এবং পুনরাবৃত্তি করা যেতে পারে।
রিটার্নস:
-
Output
: মাত্রা 0 বাদে ডেটার মতো একই আকার রয়েছে যার আকারেরk
, বিভাগগুলির সংখ্যা।
নির্মাণকারী এবং ধ্বংসকারী | |
---|---|
SparseSegmentSum (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: tensorflow::Input indices, :: tensorflow::Input segment_ids) |
জনসাধারণের গুণাবলী | |
---|---|
operation | |
output |
পাবলিক ফাংশন | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
জনসাধারণের গুণাবলী
অপারেশন
Operation operation
আউটপুট
::tensorflow::Output output
পাবলিক ফাংশন
স্পারসেসমেন্টমেন্টসাম
SparseSegmentSum( const ::tensorflow::Scope & scope, ::tensorflow::Input data, ::tensorflow::Input indices, ::tensorflow::Input segment_ids )
নোড
::tensorflow::Node * node() const
অপারেটর :: টেনসরফ্লো :: ইনপুট
operator::tensorflow::Input() const
অপারেটর :: টেনসরফ্লো :: আউটপুট
operator::tensorflow::Output() const