is_floating_point
- paddle. is_floating_point ( x: Tensor ) bool [source]
-
Returns whether the dtype of x is one of paddle.float64, paddle.float32, paddle.float16, and paddle.bfloat16.
Note
Alias Support: The parameter name
inputcan be used as an alias forx. For example,is_floating_point(input=tensor_x)is equivalent tois_floating_point(x=tensor_x).- Parameters
-
x (Tensor) – The input tensor. alias:
input. - Returns
-
True if the dtype of x is floating type, otherwise false.
- Return type
-
bool
Examples
>>> import paddle >>> x = paddle.arange(1., 5., dtype='float32') >>> y = paddle.arange(1, 5, dtype='int32') >>> print(paddle.is_floating_point(x)) True >>> print(paddle.is_floating_point(y)) False
