# tf.raw_ops.RandomCrop

<br />

Randomly crop `image`.

#### View aliases


**Compat aliases for migration**

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

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

<br />

    tf.raw_ops.RandomCrop(
        image, size, seed=0, seed2=0, name=None
    )

`size` is a 1-D int64 tensor with 2 elements representing the crop height and
width. The values must be non negative.

This Op picks a random location in `image` and crops a `height` by `width`
rectangle from that location. The random location is picked so the cropped
area will fit inside the original image.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `image` | A `Tensor`. Must be one of the following types: `uint8`, `int8`, `int16`, `int32`, `int64`, `float32`, `float64`. 3-D of shape `[height, width, channels]`. |
| `size` | A `Tensor` of type `int64`. 1-D of length 2 containing: `crop_height`, `crop_width`.. |
| `seed` | An optional `int`. Defaults to `0`. If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed. |
| `seed2` | An optional `int`. Defaults to `0`. An second seed to avoid seed collision. |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

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

<br />