tensorflow:: ops:: SparseSegmentSumWithNumSegments
#include <math_ops.h>Oblicza sumę wzdłuż rzadkich segmentów tensora.
Streszczenie
Podobnie jak SparseSegmentSum , ale dopuszcza brakujące identyfikatory w segment_ids . Jeśli brakuje identyfikatora, tensor output w tym miejscu zostanie wyzerowany.
Aby uzyskać objaśnienie segmentów, przeczytaj sekcję poświęconą segmentacji .
Na przykład:
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]]
Argumenty:
- zakres: obiekt zakresu
- Indeksy: jednowymiarowy tensor. Ma taką samą rangę jak
segment_ids. - segment_ids: Tensor jednowymiarowy. Wartości powinny być sortowane i mogą się powtarzać.
- num_segments: Powinno być równe liczbie odrębnych identyfikatorów segmentów.
Zwroty:
-
Output: Ma taki sam kształt jak dane, z wyjątkiem wymiaru 0, którego rozmiar wynosinum_segments.
Konstruktory i destruktory | |
|---|---|
SparseSegmentSumWithNumSegments (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: tensorflow::Input indices, :: tensorflow::Input segment_ids, :: tensorflow::Input num_segments) |
Atrybuty publiczne | |
|---|---|
operation | |
output | |
Funkcje publiczne | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
Atrybuty publiczne
działanie
Operation operation
wyjście
::tensorflow::Output output
Funkcje publiczne
Suma rzadkich segmentów z liczbą segmentów
SparseSegmentSumWithNumSegments( const ::tensorflow::Scope & scope, ::tensorflow::Input data, ::tensorflow::Input indices, ::tensorflow::Input segment_ids, ::tensorflow::Input num_segments )
węzeł
::tensorflow::Node * node() const
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const