@Namespace(value="tensorflow::ops") @NoOffset public static class tensorflow.SpaceToBatch extends Pointer
height and width dimensions are moved to the batch dimension. After
the zero-padding, both height and width of the input must be divisible by the
block size.
Arguments:
* scope: A Scope object
* input: 4-D with shape [batch, height, width, depth].
* paddings: 2-D tensor of non-negative integers with shape [2, 2]. It specifies
the padding of the input with zeros across the spatial dimensions as follows:
paddings = [[pad_top, pad_bottom], [pad_left, pad_right]]
The effective spatial dimensions of the zero-padded input tensor will be:
height_pad = pad_top + height + pad_bottom
width_pad = pad_left + width + pad_right
The attr block_size must be greater than one. It indicates the block size.
* Non-overlapping blocks of size block_size x block size in the height and
width dimensions are rearranged into the batch dimension at each location.
* The batch of the output tensor is batch * block_size * block_size.
* Both height_pad and width_pad must be divisible by block_size.
The shape of the output will be:
[batch*block_size*block_size, height_pad/block_size, width_pad/block_size,
depth]
Some examples:
(1) For the following input of shape [1, 2, 2, 1] and block_size of 2:
x = [[[[1], [2]], [[3], [4]]]]
The output tensor has shape [4, 1, 1, 1] and value:
[[[[1]]], [[[2]]], [[[3]]], [[[4]]]]
(2) For the following input of shape [1, 2, 2, 3] and block_size of 2:
x = [[[[1, 2, 3], [4, 5, 6]],
[[7, 8, 9], [10, 11, 12]]]]
The output tensor has shape [4, 1, 1, 3] and value:
[[[1, 2, 3]], [[4, 5, 6]], [[7, 8, 9]], [[10, 11, 12]]]
(3) For the following input of shape [1, 4, 4, 1] and block_size of 2:
x = [[[[1], [2], [3], [4]],
[[5], [6], [7], [8]],
[[9], [10], [11], [12]],
[[13], [14], [15], [16]]]]
The output tensor has shape [4, 2, 2, 1] and value:
x = [[[[1], [3]], [[9], [11]]],
[[[2], [4]], [[10], [12]]],
[[[5], [7]], [[13], [15]]],
[[[6], [8]], [[14], [16]]]]
(4) For the following input of shape [2, 2, 4, 1] and block_size of 2:
x = [[[[1], [2], [3], [4]],
[[5], [6], [7], [8]]],
[[[9], [10], [11], [12]],
[[13], [14], [15], [16]]]]
The output tensor has shape [8, 1, 2, 1] and value:
x = [[[[1], [3]]], [[[9], [11]]], [[[2], [4]]], [[[10], [12]]],
[[[5], [7]]], [[[13], [15]]], [[[6], [8]]], [[[14], [16]]]]
Among others, this operation is useful for reducing atrous convolution into
regular convolution.
Returns:
* Output: The output tensor.Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator| Constructor and Description |
|---|
SpaceToBatch(Pointer p)
Pointer cast constructor.
|
SpaceToBatch(tensorflow.Scope scope,
tensorflow.Input input,
tensorflow.Input paddings,
long block_size) |
| Modifier and Type | Method and Description |
|---|---|
tensorflow.Input |
asInput() |
tensorflow.Output |
asOutput() |
tensorflow.Node |
node() |
tensorflow.Operation |
operation() |
tensorflow.SpaceToBatch |
operation(tensorflow.Operation operation) |
tensorflow.Output |
output() |
tensorflow.SpaceToBatch |
output(tensorflow.Output output) |
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 SpaceToBatch(Pointer p)
Pointer.Pointer(Pointer).public SpaceToBatch(@Const @ByRef tensorflow.Scope scope, @ByVal tensorflow.Input input, @ByVal tensorflow.Input paddings, @Cast(value="tensorflow::int64") long block_size)
@ByVal @Name(value="operator tensorflow::Output") public tensorflow.Output asOutput()
@ByVal @Name(value="operator tensorflow::Input") public tensorflow.Input asInput()
public tensorflow.Node node()
@ByRef public tensorflow.Operation operation()
public tensorflow.SpaceToBatch operation(tensorflow.Operation operation)
@ByRef public tensorflow.Output output()
public tensorflow.SpaceToBatch output(tensorflow.Output output)
Copyright © 2019. All rights reserved.