mindspore.ops.is_floating_point
- mindspore.ops.is_floating_point(input)[source]
If the data type of the tensor is a floating point data type, return True. Otherwise return False.
- Parameters
input (Tensor) – The input Tensor.
- Returns
Bool
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> input = mindspore.tensor([False, 0j, 1, 2.1, 1+2j], mindspore.float64) >>> mindspore.ops.is_floating_point(input) True >>> >>> input = mindspore.tensor([False, 0j, 1, 2.1, 1+2j], mindspore.float32) >>> mindspore.ops.is_floating_point(input) True >>> >>> input = mindspore.tensor([False, 0j, 1, 2.1, 1+2j], mindspore.float16) >>> mindspore.ops.is_floating_point(input) True >>> >>> input = mindspore.tensor([False, 0j, 1, 2.1, 1+2j], mindspore.int32) >>> mindspore.ops.is_floating_point(input) False