latest (dev)
Copy
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
realand its imaginary part equal toimag.- Parameters:
- Keyword Arguments:
out (Tensor) – If the inputs are
tensorplay.float32, must betensorplay.complex64. If the inputs aretensorplay.float64, must betensorplay.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
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

