A tf.Tensor
. N-D with x.shape
= [batch] + spatialShape + remainingShape
, where spatialShape has M
dimensions.
A 1-D array. Must have shape [M]
, all values must
be >= 1.
A 2-D array. Must have shape [M, 2]
, all values must be >=
0. paddings[i] = [padStart, padEnd]
specifies the amount to zero-pad
from input dimension i + 1
, which corresponds to spatial dimension i
. It
is required that
(inputShape[i + 1] + padStart + padEnd) % blockShape[i] === 0
This operation is equivalent to the following steps:
Zero-pad the start and end of dimensions [1, ..., M]
of the input
according to paddings
to produce padded
of shape paddedShape.
Reshape padded
to reshapedPadded
of shape:
[batch] + [paddedShape[1] / blockShape[0], blockShape[0], ..., paddedShape[M] / blockShape[M-1], blockShape[M-1]] + remainingShape
Permute dimensions of reshapedPadded
to produce permutedReshapedPadded
of shape: blockShape + [batch] + [paddedShape[1] / blockShape[0], ..., paddedShape[M] / blockShape[M-1]] + remainingShape
Reshape permutedReshapedPadded
to flatten blockShape
into the
batch dimension, producing an output tensor of shape:
[batch * prod(blockShape)] + [paddedShape[1] / blockShape[0], ..., paddedShape[M] / blockShape[M-1]] + remainingShape
Generated using TypeDoc
This operation divides "spatial" dimensions
[1, ..., M]
of the input into a grid of blocks of shapeblockShape
, and interleaves these blocks with the "batch" dimension (0) such that in the output, the spatial dimensions[1, ..., M]
correspond to the position within the grid, and the batch dimension combines both the position within a spatial block and the original batch position. Prior to division into blocks, the spatial dimensions of the input are optionally zero padded according topaddings
. See below for a precise description.