# tf.to_double

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/math_ops.py#L762-L778) |

Casts a tensor to type `float64`. (deprecated)

#### View aliases


**Compat aliases for migration**

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

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

<br />

    tf.to_double(
        x, name='ToDouble'
    )

> [!WARNING]
> **Warning:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use [`tf.cast`](https://www.tensorflow.org/versions/r1.15/api_docs/python/tf/cast) instead.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `x` | A `Tensor` or `SparseTensor` or `IndexedSlices`. |
| `name` | A name for the operation (optional). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor` or `SparseTensor` or `IndexedSlices` with same shape as `x` with type `float64`. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `TypeError` | If `x` cannot be cast to the `float64`. |

<br />