This name was deprecated and removed in TF2, but has an exact replacement
tf.cast(..., tf.int64). There are no further issues with eager execution or
tf.function.
[null,null,["Last updated 2023-10-06 UTC."],[],[],null,["# tf.compat.v1.to_int64\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.14.0/tensorflow/python/ops/math_ops.py#L1230-L1267) |\n\nCasts a tensor to type `int64`. (deprecated) \n\n tf.compat.v1.to_int64(\n x, name='ToInt64'\n )\n\n\u003cbr /\u003e\n\nMigrate to TF2\n--------------\n\n\u003cbr /\u003e\n\n| **Caution:** This API was designed for TensorFlow v1. Continue reading for details on how to migrate from this API to a native TensorFlow v2 equivalent. See the [TensorFlow v1 to TensorFlow v2 migration guide](https://www.tensorflow.org/guide/migrate) for instructions on how to migrate the rest of your code.\n\nThis name was deprecated and removed in TF2, but has an exact replacement\n[`tf.cast(..., tf.int64)`](../../../tf/cast). There are no further issues with eager execution or\ntf.function.\n\nBefore: \n\n tf.compat.v1.to_int64(tf.constant(1, dtype=tf.int32))\n \u003ctf.Tensor: shape=(), dtype=int64, numpy=1\u003e\n\nAfter: \n\n tf.cast(tf.constant(1, dtype=tf.int32), tf.int64)\n \u003ctf.Tensor: shape=(), dtype=int64, numpy=1\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nDescription\n-----------\n\n| **Deprecated:** THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use [`tf.cast`](../../../tf/cast) instead.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------|--------------------------------------------------|\n| `x` | A `Tensor` or `SparseTensor` or `IndexedSlices`. |\n| `name` | A name for the operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A `Tensor` or `SparseTensor` or `IndexedSlices` with same shape as `x` with type `int64`. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|-------------|---------------------------------------|\n| `TypeError` | If `x` cannot be cast to the `int64`. |\n\n\u003cbr /\u003e"]]