mindspore.ops.Complex
- class mindspore.ops.Complex[source]
Returns a complex Tensor from the real part and the imag part.
Warning
This is an experimental API that is subject to change or deletion.
- Inputs:
real (Tensor) - The real input tensor. types: float32, float64.
imag (Tensor) - The imag input tensor. types: float32, float64.
- Outputs:
Tensor, has the complex type.
- Raises
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> real = Tensor(np.array([1]), mindspore.float32) >>> imag = Tensor(np.array([2]), mindspore.float32) >>> complex = ops.Complex() >>> output = complex(real, imag) >>> print(output) [1.+2.j]