From 3223addd82fac2a56549f718eba50e34eef1f703 Mon Sep 17 00:00:00 2001 From: charles-r-earp Date: Fri, 12 Jan 2024 19:12:36 -0800 Subject: [PATCH] AsPrimitive f16 <-> bf16 --- src/num_traits.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/num_traits.rs b/src/num_traits.rs index 4318699..7ffd4a6 100644 --- a/src/num_traits.rs +++ b/src/num_traits.rs @@ -718,6 +718,7 @@ impl_as_primitive_to_f16!(isize, to_f32); impl_as_primitive_to_f16!(usize, to_f32); impl_as_primitive_to_f16!(f32, to_f32); impl_as_primitive_to_f16!(f64, to_f64); +impl_as_primitive_to_f16!(bf16, to_f32); macro_rules! impl_as_primitive_f16_from { ($ty:ty, $meth:ident) => { @@ -1457,6 +1458,7 @@ impl_as_primitive_to_bf16!(isize, to_f32); impl_as_primitive_to_bf16!(usize, to_f32); impl_as_primitive_to_bf16!(f32, to_f32); impl_as_primitive_to_bf16!(f64, to_f64); +impl_as_primitive_to_bf16!(f16, to_f32); macro_rules! impl_as_primitive_bf16_from { ($ty:ty, $meth:ident) => {