conj

paddle. conj ( x, name=None ) [source]

This function computes the conjugate of the Tensor elementwisely.

Parameters
  • x (Tensor) – The input Tensor which hold the complex numbers. Optional data types are:float16, complex64, complex128, float32, float64, int32 or int64.

  • name (str, optional) – Name for the operation (optional, default is None). For more information, please refer to Name.

Returns

The conjugate of input. The shape and data type is the same with input. If the elements of tensor is real type such as float32, float64, int32 or int64, the out is the same with input.

Return type

out (Tensor)

Examples

>>> import paddle

>>> data = paddle.to_tensor([[1+1j, 2+2j, 3+3j], [4+4j, 5+5j, 6+6j]])
>>> data
Tensor(shape=[2, 3], dtype=complex64, place=Place(cpu), stop_gradient=True,
[[(1+1j), (2+2j), (3+3j)],
 [(4+4j), (5+5j), (6+6j)]])

>>> conj_data = paddle.conj(data)
>>> conj_data
Tensor(shape=[2, 3], dtype=complex64, place=Place(cpu), stop_gradient=True,
[[(1-1j), (2-2j), (3-3j)],
 [(4-4j), (5-5j), (6-6j)]])