MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / SegmentSum

Function SegmentSum

tensorflow/go/op/wrappers.go:20396–20408  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

20394// Returns Has same shape as data, except for dimension 0 which
20395// has size `k`, the number of segments.
20396func 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.
20411type TPUReplicateMetadataAttr func(optionalAttr)

Callers 1

TEST_FFunction · 0.85

Calls 3

ErrMethod · 0.45
AddOperationMethod · 0.45
OutputMethod · 0.45

Tested by 1

TEST_FFunction · 0.68