spd_learn.functional.is_half_precision#

spd_learn.functional.is_half_precision(dtype: dtype) → bool[source]#

Check if dtype is half precision (float16 or bfloat16).

Parameters:

dtype (torch.dtype) – The dtype to check.

Returns:

True if the dtype is float16 or bfloat16.

Return type:

bool