tf.math.conj
Stay organized with collections
Save and categorize content based on your preferences.
Returns the complex conjugate of a complex number.
tf.math.conj(
x, name=None
)
Given a tensor x
of complex numbers, this operation returns a tensor of
complex numbers that are the complex conjugate of each element in x
. The
complex numbers in x
must be of the form \(a + bj\), where a
is the
real part and b
is the imaginary part.
The complex conjugate returned by this operation is of the form \(a - bj\).
For example:
x = tf.constant([-2.25 + 4.75j, 3.25 + 5.75j])
tf.math.conj(x)
<tf.Tensor: shape=(2,), dtype=complex128,
numpy=array([-2.25-4.75j, 3.25-5.75j])>
If x
is real, it is returned unchanged.
For example:
x = tf.constant([-2.25, 3.25])
tf.math.conj(x)
<tf.Tensor: shape=(2,), dtype=float32,
numpy=array([-2.25, 3.25], dtype=float32)>
Args |
x
|
Tensor to conjugate. Must have numeric or variant type.
|
name
|
A name for the operation (optional).
|
Returns |
A Tensor that is the conjugate of x (with the same type).
|
Raises |
TypeError
|
If x is not a numeric tensor.
|
Equivalent to numpy.conj.
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.
[[["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.math.conj\n\n|------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/ops/math_ops.py#L4349-L4405) |\n\nReturns the complex conjugate 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.conj`](https://www.tensorflow.org/api_docs/python/tf/math/conj)\n\n\u003cbr /\u003e\n\n tf.math.conj(\n x, name=None\n )\n\nGiven a tensor `x` of complex numbers, this operation returns a tensor of\ncomplex numbers that are the complex conjugate of each element in `x`. The\ncomplex numbers in `x` must be of the form \\\\(a + bj\\\\), where `a` is the\nreal part and `b` is the imaginary part.\n\nThe complex conjugate returned by this operation is of the form \\\\(a - bj\\\\).\n\n#### For example:\n\n x = tf.constant([-2.25 + 4.75j, 3.25 + 5.75j])\n tf.math.conj(x)\n \u003ctf.Tensor: shape=(2,), dtype=complex128,\n numpy=array([-2.25-4.75j, 3.25-5.75j])\u003e\n\nIf `x` is real, it is returned unchanged.\n\n#### For example:\n\n x = tf.constant([-2.25, 3.25])\n tf.math.conj(x)\n \u003ctf.Tensor: shape=(2,), dtype=float32,\n numpy=array([-2.25, 3.25], dtype=float32)\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|--------|-----------------------------------------------------------|\n| `x` | `Tensor` to conjugate. Must have numeric or variant type. |\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` that is the conjugate of `x` (with the same type). ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|-------------|---------------------------------|\n| `TypeError` | If `x` is not a numeric tensor. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nnumpy compatibility\n-------------------\n\n\u003cbr /\u003e\n\nEquivalent to numpy.conj.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e"]]