@Namespace(value="tensorflow::ops") @NoOffset @Properties(inherit=tensorflow.class) public class SparseSegmentSum extends Pointer
SegmentSum
, but segment_ids
can have rank less than data
's first
dimension, selecting a subset of dimension 0, specified by indices
.
For example:
python
c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])
# Select two rows, one segment.
tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 0]))
# => [[0 0 0 0]]
# Select two rows, two segment.
tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 1]))
# => [[ 1 2 3 4]
# [-1 -2 -3 -4]]
# Select all rows, two segments.
tf.sparse_segment_sum(c, tf.constant([0, 1, 2]), tf.constant([0, 0, 1]))
# => [[0 0 0 0]
# [5 6 7 8]]
# Which is equivalent to:
tf.segment_sum(c, tf.constant([0, 0, 1]))
Arguments:
* scope: A Scope object
* indices: A 1-D tensor. Has same rank as segment_ids
.
* segment_ids: A 1-D tensor. Values should be sorted and can be repeated.
Returns:
* Output
: Has same shape as data, except for dimension 0 which
has size k
, the number of segments.Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
SparseSegmentSum(Pointer p)
Pointer cast constructor.
|
SparseSegmentSum(Scope scope,
Input data,
Input indices,
Input segment_ids) |
Modifier and Type | Method and Description |
---|---|
Input |
asInput() |
Output |
asOutput() |
Node |
node() |
Operation |
operation() |
SparseSegmentSum |
operation(Operation setter) |
Output |
output() |
SparseSegmentSum |
output(Output setter) |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public SparseSegmentSum(Pointer p)
Pointer(Pointer)
.public Node node()
public SparseSegmentSum operation(Operation setter)
public SparseSegmentSum output(Output setter)
Copyright © 2022. All rights reserved.