@Namespace(value="tensorflow::ops") @NoOffset public static class tensorflow.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| Constructor and Description |
|---|
DynamicPartition(Pointer p)
Pointer cast constructor.
|
DynamicPartition(tensorflow.Scope scope,
tensorflow.Input data,
tensorflow.Input partitions,
long num_partitions) |
| Modifier and Type | Method and Description |
|---|---|
tensorflow.Output |
get(long index) |
tensorflow.Operation |
operation() |
tensorflow.DynamicPartition |
operation(tensorflow.Operation operation) |
tensorflow.OutputVector |
outputs() |
tensorflow.DynamicPartition |
outputs(tensorflow.OutputVector outputs) |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, position, put, realloc, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zeropublic DynamicPartition(Pointer p)
Pointer.Pointer(Pointer).public DynamicPartition(@Const @ByRef tensorflow.Scope scope, @ByVal tensorflow.Input data, @ByVal tensorflow.Input partitions, @Cast(value="tensorflow::int64") long num_partitions)
@ByVal @Name(value="operator []") public tensorflow.Output get(@Cast(value="size_t") long index)
@ByRef public tensorflow.Operation operation()
public tensorflow.DynamicPartition operation(tensorflow.Operation operation)
@ByRef @Cast(value="tensorflow::OutputList*") public tensorflow.OutputVector outputs()
public tensorflow.DynamicPartition outputs(tensorflow.OutputVector outputs)
Copyright © 2019. All rights reserved.