Casts a tensor to type `int32`. Args: x: A `Tensor` or `SparseTensor` or `IndexedSlices`. name: A name for the operation (optional). Returns: A `Tensor` or `SparseTensor` or `IndexedSlices` with same shape as `x` with type `int32`. Raises: TypeError: If `x` cannot be cas
(x, name="ToInt32")
| 781 | @deprecation.deprecated(date=None, instructions="Use `tf.cast` instead.") |
| 782 | @tf_export(v1=["to_int32"]) |
| 783 | def to_int32(x, name="ToInt32"): |
| 784 | """Casts a tensor to type `int32`. |
| 785 | |
| 786 | Args: |
| 787 | x: A `Tensor` or `SparseTensor` or `IndexedSlices`. |
| 788 | name: A name for the operation (optional). |
| 789 | |
| 790 | Returns: |
| 791 | A `Tensor` or `SparseTensor` or `IndexedSlices` with same shape as `x` with |
| 792 | type `int32`. |
| 793 | |
| 794 | Raises: |
| 795 | TypeError: If `x` cannot be cast to the `int32`. |
| 796 | """ |
| 797 | return cast(x, dtypes.int32, name=name) |
| 798 | |
| 799 | |
| 800 | @deprecation.deprecated(date=None, instructions="Use `tf.cast` instead.") |