torch.is_floating_point

torch.is_floating_point(input)

如果 input 的数据类型是浮点数类型(即 torch.float64torch.float32torch.float16torch.bfloat16 之一),则返回 True。

参数

input (Tensor) – 需要输入的张量。

本页目录