Casts a tensor to type `complex128`. 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 `complex128`. Raises: TypeError: If `x` can
(x, name="ToComplex128")
| 857 | @deprecation.deprecated(date=None, instructions="Use `tf.cast` instead.") |
| 858 | @tf_export(v1=["to_complex128"]) |
| 859 | def to_complex128(x, name="ToComplex128"): |
| 860 | """Casts a tensor to type `complex128`. |
| 861 | |
| 862 | Args: |
| 863 | x: A `Tensor` or `SparseTensor` or `IndexedSlices`. |
| 864 | name: A name for the operation (optional). |
| 865 | |
| 866 | Returns: |
| 867 | A `Tensor` or `SparseTensor` or `IndexedSlices` with same shape as `x` with |
| 868 | type `complex128`. |
| 869 | |
| 870 | Raises: |
| 871 | TypeError: If `x` cannot be cast to the `complex128`. |
| 872 | """ |
| 873 | return cast(x, dtypes.complex128, name=name) |
| 874 | |
| 875 | |
| 876 | ops.Tensor._override_operator("__neg__", gen_math_ops.neg) |