《魔兽世界》新资料片将移除急救专业 相关成就即将绝版

paddle. complex ( real: Tensor, imag: Tensor, name: Optional[str] = None ) Tensor [source]
百度   据警方调查,这些“保健品”主要是些糖果类压缩片,一盒成本价只要几十元,却卖到两三千元。

Return a complex tensor given the real and image component.

Parameters
  • real (Tensor) – The real component. The data type should be ‘float32’ or ‘float64’.

  • imag (Tensor) – The image component. The data type should be the same as real.

  • name (str|None, optional) – For details, please refer to Name. Generally, no setting is required. Default: None.

Returns

Tensor, The output tensor. The data type is ‘complex64’ or ‘complex128’, with the same precision as real and imag.

Note

paddle.complex supports broadcasting. If you want know more about broadcasting, please refer to Introduction to Tensor .

Examples

>>> import paddle
>>> x = paddle.arange(2, dtype=paddle.float32).unsqueeze(-1)
>>> y = paddle.arange(3, dtype=paddle.float32)
>>> z = paddle.complex(x, y)
>>> print(z)
Tensor(shape=[2, 3], dtype=complex64, place=Place(cpu), stop_gradient=True,
[[0j    , 1j    , 2j    ],
 [(1+0j), (1+1j), (1+2j)]])