Computes the sum along segments of a tf.Tensor.
tf.Tensor
const x = tf.tensor1d([1, 2, 3, 4]);const segmentIds = tf.tensor1d([1, 2, 0, 1], 'int32');const numSegments = 3;x.unsortedSegmentSum(segmentIds, numSegments).print()//or tf.unsortedSegmentSum(x, segmentIds, numSegments) Copy
const x = tf.tensor1d([1, 2, 3, 4]);const segmentIds = tf.tensor1d([1, 2, 0, 1], 'int32');const numSegments = 3;x.unsortedSegmentSum(segmentIds, numSegments).print()//or tf.unsortedSegmentSum(x, segmentIds, numSegments)
The tf.Tensor that will be summed along its segments.
A tf.Tensor1D whose rank is equal to the rank of x's dimension along the axis. Maps each element of x to a segment.
tf.Tensor1D
x
axis
The number of distinct segmentIds.
segmentIds
Generated using TypeDoc
Computes the sum along segments of a
tf.Tensor
.