@@ -817,17 +817,17 @@ function batchToSpaceND_<T extends Tensor>(
817
817
}
818
818
819
819
/**
820
- * This operation divides "spatial" dimensions [1, ..., M] of the input into
821
- * a grid of blocks of shape block_shape , and interleaves these blocks with
820
+ * This operation divides "spatial" dimensions ` [1, ..., M]` of the input into
821
+ * a grid of blocks of shape `blockShape` , and interleaves these blocks with
822
822
* the "batch" dimension (0) such that in the output, the spatial
823
- * dimensions [1, ..., M] correspond to the position within the grid,
823
+ * dimensions ` [1, ..., M]` correspond to the position within the grid,
824
824
* and the batch dimension combines both the position within a spatial block
825
825
* and the original batch position. Prior to division into blocks,
826
826
* the spatial dimensions of the input are optionally zero padded
827
- * according to paddings. See below for a precise description.
827
+ * according to ` paddings` . See below for a precise description.
828
828
*
829
829
* ```js
830
- * const x = tf.tensor4d([1, 2, 3, 4], [4, 1, 1 , 1]);
830
+ * const x = tf.tensor4d([1, 2, 3, 4], [1, 2, 2 , 1]);
831
831
* const blockShape = [2, 2];
832
832
* const paddings = [[0, 0], [0, 0]];
833
833
*
@@ -836,33 +836,31 @@ function batchToSpaceND_<T extends Tensor>(
836
836
*
837
837
* @param x A `tf.Tensor`. N-D with `x.shape` = `[batch] + spatialShape +
838
838
* remainingShape`, where spatialShape has `M` dimensions.
839
- * @param blockShape A 1-D array. Must be one of the following types: `int32`,
840
- * `int64`. Must have shape `[M]`, all values must be >= 1.
841
- * @param paddings A 2-D array. Must be one of the following types: `int32`,
842
- * `int64`. Must have shape `[M, 2]`, all values must be >= 0. `paddings[i] =
843
- * [padStart, padEnd]` specifies the amount to zero-pad from input dimension
844
- * `i + 1`, which corresponds to spatial dimension `i`.
845
- * It is required that
839
+ * @param blockShape A 1-D array. Must have shape `[M]`, all values must
840
+ * be >= 1.
841
+ * @param paddings A 2-D array. Must have shape `[M, 2]`, all values must be >=
842
+ * 0. `paddings[i] = [padStart, padEnd]` specifies the amount to zero-pad
843
+ * from input dimension `i + 1`, which corresponds to spatial dimension `i`. It
844
+ * is required that
846
845
* `(inputShape[i + 1] + padStart + padEnd) % blockShape[i] === 0`
847
846
*
848
847
* This operation is equivalent to the following steps:
849
848
*
850
- * 1. Zero-pad the start and end of dimensions [1, ..., M] of the input
851
- * according to paddings to produce padded of shape padded_shape .
849
+ * 1. Zero-pad the start and end of dimensions ` [1, ..., M]` of the input
850
+ * according to ` paddings` to produce ` padded` of shape paddedShape .
852
851
*
853
- * 2. Reshape padded to reshaped_padded of shape:
854
- * [batch] + [padded_shape [1] / block_shape [0], block_shape [0], ...,
855
- * padded_shape [M] / block_shape [M-1], block_shape [M-1]] + remaining_shape
852
+ * 2. Reshape ` padded` to `reshapedPadded` of shape:
853
+ * ` [batch] + [paddedShape [1] / blockShape [0], blockShape [0], ...,
854
+ * paddedShape [M] / blockShape [M-1], blockShape [M-1]] + remainingShape`
856
855
*
857
- * 3. Permute dimensions of reshaped_padded to produce permuted_
858
- * reshaped_padded of shape:
859
- * block_shape + [batch] + [padded_shape[1] / block_shape[0], ...,
860
- * padded_shape[M] / block_shape[M-1]] + remaining_shape
856
+ * 3. Permute dimensions of `reshapedPadded` to produce `permutedReshapedPadded`
857
+ * of shape: `blockShape + [batch] + [paddedShape[1] / blockShape[0], ...,
858
+ * paddedShape[M] / blockShape[M-1]] + remainingShape`
861
859
*
862
- * 4. Reshape permuted_reshaped_padded to flatten block_shape into the
860
+ * 4. Reshape `permutedReshapedPadded` to flatten `blockShape` into the
863
861
* batch dimension, producing an output tensor of shape:
864
- * [batch * prod(block_shape )] + [padded_shape [1] / block_shape [0], ...,
865
- * padded_shape [M] / block_shape [M-1]] + remaining_shape
862
+ * ` [batch * prod(blockShape )] + [paddedShape [1] / blockShape [0], ...,
863
+ * paddedShape [M] / blockShape [M-1]] + remainingShape`
866
864
*/
867
865
/** @doc {heading: 'Tensors', subheading: 'Transformations'} */
868
866
function spaceToBatchND_ < T extends Tensor > (
0 commit comments