mindspore.ops.is_floating_point

View Source On Gitee
mindspore.ops.is_floating_point(input)[source]

Judge whether the data type of input is a floating point data type i.e., one of mindspore.float64, mindspore.float32, mindspore.float16.

Parameters

input (Tensor) – The input Tensor.

Returns

Bool. If the dtype of input is a floating point data type, return True . Otherwise, return False .

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore as ms
>>> from mindspore import ops
>>> from mindspore import Tensor
>>> x = ms.Tensor([1, 2, 3], ms.float32)
>>> y = ms.Tensor([1, 2, 3], ms.int64)
>>> output = ops.is_floating_point(x)
>>> output2 = ops.is_floating_point(y)
>>> print(output)
True
>>> print(output2)
False