xnn.common.models.ops.segment_sum#

xnn.common.models.ops.segment_sum(x, lengths)[source]#

Sum of consecutive segments of x along dim 0; lengths (int64) sum to len(x).

A segmented reduction (no atomics) for values that arrive grouped, such as the triplets of a center; differentiable to any order (see _SegmentSum).

Parameters:
Return type:

Tensor