Given a tensor real representing the real part of a complex number, and a
tensor imag representing the imaginary part of a complex number, this
operation returns complex numbers elementwise of the form , where
a represents the real part and b represents the imag part.
The input tensors real and imag must have the same shape.
For example:
# tensor 'real' is [2.25, 3.25]# tensor `imag` is [4.75, 5.75]tf.complex(real,imag)==> [[2.25+4.75j],[3.25+5.75j]]
Args
real
A Tensor. Must be one of the following types: float32, float64.
imag
A Tensor. Must have the same type as real.
Tout
An optional tf.DType from: tf.complex64, tf.complex128. Defaults to tf.complex64.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[],null,["# tf.raw_ops.Complex\n\nConverts two real numbers to 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.Complex`](https://www.tensorflow.org/api_docs/python/tf/raw_ops/Complex)\n\n\u003cbr /\u003e\n\n tf.raw_ops.Complex(\n real,\n imag,\n Tout=../../tf/dtypes#complex64,\n name=None\n )\n\nGiven a tensor `real` representing the real part of a complex number, and a\ntensor `imag` representing the imaginary part of a complex number, this\noperation returns complex numbers elementwise of the form \\\\(a + bj\\\\), where\n*a* represents the `real` part and *b* represents the `imag` part.\n\nThe input tensors `real` and `imag` must have the same shape.\n\n#### For example:\n\n # tensor 'real' is [2.25, 3.25]\n # tensor `imag` is [4.75, 5.75]\n tf.complex(real, imag) ==\u003e [[2.25 + 4.75j], [3.25 + 5.75j]]\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------|----------------------------------------------------------------------------------------------------------------------------------------|\n| `real` | A `Tensor`. Must be one of the following types: `float32`, `float64`. |\n| `imag` | A `Tensor`. Must have the same type as `real`. |\n| `Tout` | An optional [`tf.DType`](../../tf/dtypes/DType) from: `tf.complex64, tf.complex128`. Defaults to [`tf.complex64`](../../tf#complex64). |\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"]]