@Namespace(value="tensorflow::ops") @NoOffset @Properties(inherit=tensorflow.class) public class DynamicPartition extends Pointer
data
into num_partitions
tensors using indices from partitions
.
For each index tuple js
of size partitions.ndim
, the slice data[js, ...]
becomes part of outputs[partitions[js]]
. The slices with partitions[js] = i
are placed in outputs[i]
in lexicographic order of js
, and the first
dimension of outputs[i]
is the number of entries in partitions
equal to i
.
In detail,
python
outputs[i].shape = [sum(partitions == i)] + data.shape[partitions.ndim:]
outputs[i] = pack([data[js, ...] for js if partitions[js] == i])
data.shape
must start with partitions.shape
.
For example:
python
# Scalar partitions.
partitions = 1
num_partitions = 2
data = [10, 20]
outputs[0] = [] # Empty with shape [0, 2]
outputs[1] = [[10, 20]]
# Vector partitions.
partitions = [0, 0, 1, 1, 0]
num_partitions = 2
data = [10, 20, 30, 40, 50]
outputs[0] = [10, 20, 50]
outputs[1] = [30, 40]
See dynamic_stitch
for an example on how to merge partitions back.
[0, num_partitions)
.
* num_partitions: The number of partitions to output.
Returns:
* OutputList
: The outputs tensor.Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
DynamicPartition(Pointer p)
Pointer cast constructor.
|
DynamicPartition(Scope scope,
Input data,
Input partitions,
long num_partitions) |
Modifier and Type | Method and Description |
---|---|
Output |
get(long index) |
Operation |
operation() |
DynamicPartition |
operation(Operation setter) |
OutputVector |
outputs() |
DynamicPartition |
outputs(OutputVector 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 DynamicPartition(Pointer p)
Pointer(Pointer)
.public DynamicPartition operation(Operation setter)
@ByRef @Cast(value="tensorflow::OutputList*") public OutputVector outputs()
public DynamicPartition outputs(OutputVector setter)
Copyright © 2022. All rights reserved.