中毒双面间谍被曝曾致信普京请求宽恕 俄方回应

paddle. is_complex ( x: Tensor ) bool [source]
百度 肿瘤发现太晚、治愈率低等情况长期存在。

Return whether x is a tensor of complex data type(complex64 or complex128).

Parameters

x (Tensor) – The input tensor.

Returns

True if the data type of the input is complex data type, otherwise false.

Return type

bool

Examples

>>> import paddle

>>> x = paddle.to_tensor([1 + 2j, 3 + 4j])
>>> print(paddle.is_complex(x))
True

>>> x = paddle.to_tensor([1.1, 1.2])
>>> print(paddle.is_complex(x))
False

>>> x = paddle.to_tensor([1, 2, 3])
>>> print(paddle.is_complex(x))
False