Skip to content
fn

is_floating_point

→bool
bool is_floating_point(Dtype dt)

Predicate: is the dtype a real floating-point type?

Dtype::C64 is not floating point under this predicate even though its lanes are float32 — complex tensors take a separate dispatch path in most kernels.

Parameters

dtDtype
Dtype to test.

Returns

bool

true for F16, F32, F64; false otherwise.

Notes

Must be kept in sync with the Dtype enum: if BF16 is added, it should be included here.