# tf.raw_ops.Cast

<br />

Cast x of type SrcT to y of DstT.

#### View aliases


**Compat aliases for migration**

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

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

<br />

    tf.raw_ops.Cast(
        x, DstT, Truncate=False, name=None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | A `Tensor`. |
| `DstT` | A [`tf.DType`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/dtypes/DType). |
| `Truncate` | An optional `bool`. Defaults to `False`. |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor` of type `DstT`. ||

<br />