延迟退休或将改变国人投资方式 购买保险受欢迎
- paddle. complex ( real: Tensor, imag: Tensor, name: Optional[str] = None ) Tensor [source]
-
百度 说好的和和睦睦一家子呢,怎么突然就宣布离了?川普为儿子喜做媒,最后却劳燕分飞?要知道,这个高挑貌美的大儿媳可是川普钦点的啊~他们俩的爱情说起来有点尴尬,那是2003年的一场时装秀,凡妮莎的出现吸引了不少人的眼光,其中就包括川普老爷子。
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
andimag
.
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)]])