UnsortedSegmentSum
tensorflow C++ API
Computes the sum along segments of a tensor.
Summary
Read the section on segmentation for an explanation of segments.
Computes a tensor such that(output[i] = sum_{j...} data[j...]
where the sum is over tuplesj...
such thatsegment_ids[j...] == i
. UnlikeSegmentSum
,segment_ids
need not be sorted and need not cover all values in the full range of valid values.
If the sum is empty for a given segment IDi
,output[i] = 0
.
num_segments
should equal the number of distinct segment IDs.
Arguments:
- scope: A Scope object
- segment_ids: A tensor whose shape is a prefix of
data.shape
.
Returns:
Output
: Has same shape as data, except for the firstsegment_ids.rank
dimensions, which are replaced with a single dimension which has sizenum_segments
.
Constructor
- UnsortedSegmentSum(const ::tensorflow::Scope & scope, ::tensorflow::Input data, ::tensorflow::Input segment_ids, ::tensorflow::Input num_segments)
Public attributes
- tensorflow::Output output.
UnsortedSegmentSum block
Source link : https://github.com/EXPNUNI/enuSpaceTensorflow/blob/master/enuSpaceTensorflow/tf_math.cpp
Argument:
- Scope scope : A Scope object (A scope is generated automatically each page. A scope is not connected.).
- Input data:connect Input node.
- Input segment_ids:connect Input node.
- Input num_segments : connect Input node.
Return:
- Output output: Output object of UnsortedSegmentSum class object.
Result:
- std::vector(Tensor) product_result : Returned object of executed result by calling session.