aliran tensor:: operasi:: Jumlah Segmen Jarang

#include <math_ops.h>

Menghitung jumlah sepanjang segmen tensor yang jarang.

Ringkasan

Baca bagian segmentasi untuk penjelasan segmen.

Seperti SegmentSum , tetapi segment_ids dapat memiliki peringkat lebih kecil dari dimensi pertama data , dengan memilih subkumpulan dimensi 0, yang ditentukan oleh indices .

Misalnya:

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]))

Argumen:

  • ruang lingkup: Objek Lingkup
  • indeks: Tensor 1-D. Memiliki peringkat yang sama dengan segment_ids .
  • segment_ids: Tensor 1-D. Nilai harus diurutkan dan dapat diulang.

Pengembalian:

  • Output : Bentuknya sama dengan data, kecuali dimensi 0 yang mempunyai ukuran k , jumlah segmen.

Konstruktor dan Destruktor

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

Atribut publik

operation
output

Fungsi publik

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

Atribut publik

operasi

Operation operation

keluaran

::tensorflow::Output output

Fungsi publik

Jumlah Segmen Jarang

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

simpul

::tensorflow::Node * node() const 

operator::tensorflow::Masukan

 operator::tensorflow::Input() const 

operator::tensorflow::Keluaran

 operator::tensorflow::Output() const