Thursday, January 22, 2026
HomeLanguagesPython – tensorflow.math.conj()

Python – tensorflow.math.conj()

TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks.  conj() is used to find element wise complex conjugate of complex input tensor.

Syntax: tensorflow.math.conj(  x, name)

Parameters:

  • x: It’s a tensor and it must have numeric values.
  • name(optional): It defines the name for the operation.

Returns:
It return a tensor of same dtype as x.
It will raise TypeError if input is not numeric tensor.
 

Example 1:

Python3




# importing the library
import tensorflow as tf
 
# Initializing the input tensor
a = tf.constant([1+5j,3+2j,4+1j],dtype = tf.complex128)
 
# Printing the input tensor
print('a: ',a)
 
# Finding the complex conjugate
res = tf.math.conj(a)
 
# Printing the result
print('Complex Conjugate: ',res)


Output:

a:  tf.Tensor([1.+5.j 3.+2.j 4.+1.j], shape=(3,), dtype=complex128)
Complex Conjugate:  tf.Tensor([1.-5.j 3.-2.j 4.-1.j], shape=(3,), dtype=complex128)

Example 2: This example uses input with dtype float64.

Python3




# importing the library
import tensorflow as tf
 
# Initializing the input tensor
a = tf.constant([1, 2, 3],dtype = tf.float64)
 
# Printing the input tensor
print('a: ',a)
 
# Finding the complex conjugate
res = tf.math.conj(a)
 
# Printing the result
print('Complex Conjugate: ',res)


Output:

a:  tf.Tensor([1. 2. 3.], shape=(3,), dtype=float64)
Complex Conjugate:  tf.Tensor([1. 2. 3.], shape=(3,), dtype=float64)
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32475 POSTS0 COMMENTS
Milvus
119 POSTS0 COMMENTS
Nango Kala
6847 POSTS0 COMMENTS
Nicole Veronica
11977 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12064 POSTS0 COMMENTS
Shaida Kate Naidoo
6986 POSTS0 COMMENTS
Ted Musemwa
7220 POSTS0 COMMENTS
Thapelo Manthata
6933 POSTS0 COMMENTS
Umr Jansen
6912 POSTS0 COMMENTS