Computes the sum along segments of a tensor. Read [the section on segmentation](https://tensorflow.org/api_docs/python/tf/math#Segmentation) for an explanation of segments. Computes a tensor such that \\(output_i = \sum_j data_j\\) where sum is over `j` such that `segment_ids[j] == i`. If the sum
(scope *Scope, data tf.Output, segment_ids tf.Output)
| 20394 | // Returns Has same shape as data, except for dimension 0 which |
| 20395 | // has size `k`, the number of segments. |
| 20396 | func SegmentSum(scope *Scope, data tf.Output, segment_ids tf.Output) (output tf.Output) { |
| 20397 | if scope.Err() != nil { |
| 20398 | return |
| 20399 | } |
| 20400 | opspec := tf.OpSpec{ |
| 20401 | Type: "SegmentSum", |
| 20402 | Input: []tf.Input{ |
| 20403 | data, segment_ids, |
| 20404 | }, |
| 20405 | } |
| 20406 | op := scope.AddOperation(opspec) |
| 20407 | return op.Output(0) |
| 20408 | } |
| 20409 | |
| 20410 | // TPUReplicateMetadataAttr is an optional argument to TPUReplicateMetadata. |
| 20411 | type TPUReplicateMetadataAttr func(optionalAttr) |