tf.raw_ops.Real
Stay organized with collections
Save and categorize content based on your preferences.
Returns the real part of a complex number.
tf.raw_ops.Real(
input,
Tout=tf.dtypes.float32
,
name=None
)
Given a tensor input
of complex numbers, this operation returns a tensor of
type float
that is the real part of each element in input
. All elements in
input
must be complex numbers of the form \(a + bj\), where a is the real
part returned by this operation and b is the imaginary part.
For example:
# tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]
tf.real(input) ==> [-2.25, 3.25]
Args |
input
|
A Tensor . Must be one of the following types: complex64 , complex128 .
|
Tout
|
An optional tf.DType from: tf.float32, tf.float64 . Defaults to tf.float32 .
|
name
|
A name for the operation (optional).
|
Returns |
A Tensor of type Tout .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-04-26 UTC.
[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tf.raw_ops.Real\n\nReturns the real part of a complex number.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.raw_ops.Real`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/Real)\n\n\u003cbr /\u003e\n\n tf.raw_ops.Real(\n input,\n Tout=../../tf/dtypes#float32,\n name=None\n )\n\nGiven a tensor `input` of complex numbers, this operation returns a tensor of\ntype `float` that is the real part of each element in `input`. All elements in\n`input` must be complex numbers of the form \\\\(a + bj\\\\), where *a* is the real\npart returned by this operation and *b* is the imaginary part.\n\n#### For example:\n\n # tensor 'input' is [-2.25 + 4.75j, 3.25 + 5.75j]\n tf.real(input) ==\u003e [-2.25, 3.25]\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---------|-------------------------------------------------------------------------------------------------------------------------------|\n| `input` | A `Tensor`. Must be one of the following types: `complex64`, `complex128`. |\n| `Tout` | An optional [`tf.DType`](../../tf/dtypes/DType) from: `tf.float32, tf.float64`. Defaults to [`tf.float32`](../../tf#float32). |\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` of type `Tout`. ||\n\n\u003cbr /\u003e"]]