torch.is_floating_point

torch.is_floating_point(input) -> (bool)

Returns True if the data type of input is a floating point data type i.e., one of torch.float64, torch.float32, torch.float16, and torch.bfloat16.

Parameters

input (Tensor) – the input tensor.

© 2019 Torch Contributors
Licensed under the 3-clause BSD License.
https://pytorch.org/docs/1.8.0/generated/torch.is_floating_point.html