# tf.raw_ops.BatchToSpace

<br />

BatchToSpace for 4-D tensors of type T.

#### View aliases


**Compat aliases for migration**

See
[Migration guide](https://www.tensorflow.org/guide/migrate) for
more details.

[`tf.compat.v1.raw_ops.BatchToSpace`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/BatchToSpace)

<br />

    tf.raw_ops.BatchToSpace(
        input, crops, block_size, name=None
    )

This is a legacy version of the more general BatchToSpaceND.

Rearranges (permutes) data from batch into blocks of spatial data, followed by
cropping. This is the reverse transformation of SpaceToBatch. More specifically,
this op outputs a copy of the input tensor where values from the `batch`
dimension are moved in spatial blocks to the `height` and `width` dimensions,
followed by cropping along the `height` and `width` dimensions.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `input` | A `Tensor`. 4-D tensor with shape `[batch*block_size*block_size, height_pad/block_size, width_pad/block_size, depth]`. Note that the batch size of the input tensor must be divisible by `block_size * block_size`. |
| `crops` | A `Tensor`. Must be one of the following types: `int32`, `int64`. 2-D tensor of non-negative integers with shape `[2, 2]`. It specifies how many elements to crop from the intermediate result across the spatial dimensions as follows: <br /> crops = [[crop_top, crop_bottom], [crop_left, crop_right]] <br /> |
| `block_size` | An `int` that is `>= 2`. |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor`. Has the same type as `input`. ||

<br />