TensorPlay
latest (dev)
Copy
View Markdown

Latest development documentation · Updated 2026-10-15

tensorplay.functional.complex

tensorplay.functional.complex(real, imag, *, out=None) → Tensor[source]

Constructs a complex tensor with its real part equal to real and its imaginary part equal to imag.

Parameters:
  • real (Tensor) – The real part of the complex tensor. Must be half, float or double.

  • imag (Tensor) – The imaginary part of the complex tensor. Must be same dtype as real.

Keyword Arguments:

out (Tensor) – If the inputs are tensorplay.float32, must be tensorplay.complex64. If the inputs are tensorplay.float64, must be tensorplay.complex128.

Example:

>>> real = tensorplay.tensor([1, 2], dtype=tensorplay.float32)
>>> imag = tensorplay.tensor([3, 4], dtype=tensorplay.float32)
>>> z = tensorplay.complex(real, imag)
>>> z
tensor([(1.+3.j), (2.+4.j)])
>>> z.dtype
tensorplay.complex64

On this page

Ask DeepWiki