@@ -337,7 +337,7 @@ impl HasAfEnum for f16 {
337
337
type AbsOutType = Self ;
338
338
type ArgOutType = Self ;
339
339
type UnaryOutType = Self ;
340
- type ComplexOutType = Complex < f16 > ;
340
+ type ComplexOutType = Complex < f32 > ;
341
341
type MeanOutType = Self ;
342
342
type AggregateOutType = f32 ;
343
343
type ProductOutType = f32 ;
@@ -678,12 +678,18 @@ impl FloatingPoint for f32 {
678
678
true
679
679
}
680
680
}
681
+ impl FloatingPoint for f16 {
682
+ fn is_real ( ) -> bool {
683
+ true
684
+ }
685
+ }
681
686
682
687
///Trait qualifier to accept real data(numbers)
683
688
pub trait RealFloating : HasAfEnum { }
684
689
685
690
impl RealFloating for f64 { }
686
691
impl RealFloating for f32 { }
692
+ impl RealFloating for f16 { }
687
693
688
694
///Trait qualifier to accept complex data(numbers)
689
695
pub trait ComplexFloating : HasAfEnum { }
@@ -696,6 +702,7 @@ pub trait RealNumber: HasAfEnum {}
696
702
697
703
impl RealNumber for f64 { }
698
704
impl RealNumber for f32 { }
705
+ impl RealNumber for f16 { }
699
706
impl RealNumber for i32 { }
700
707
impl RealNumber for u32 { }
701
708
impl RealNumber for i16 { }
@@ -856,6 +863,8 @@ impl Fromf64 for u32 { fn fromf64(value: f64) -> Self { value as Self }}
856
863
#[ rustfmt:: skip]
857
864
impl Fromf64 for i32 { fn fromf64 ( value : f64 ) -> Self { value as Self } }
858
865
#[ rustfmt:: skip]
866
+ impl Fromf64 for f16 { fn fromf64 ( value : f64 ) -> Self { f16:: from_f64 ( value) } }
867
+ #[ rustfmt:: skip]
859
868
impl Fromf64 for u16 { fn fromf64 ( value : f64 ) -> Self { value as Self } }
860
869
#[ rustfmt:: skip]
861
870
impl Fromf64 for i16 { fn fromf64 ( value : f64 ) -> Self { value as Self } }
@@ -873,6 +882,7 @@ impl IndexableType for u64 {}
873
882
impl IndexableType for f32 { }
874
883
impl IndexableType for i32 { }
875
884
impl IndexableType for u32 { }
885
+ impl IndexableType for f16 { }
876
886
impl IndexableType for i16 { }
877
887
impl IndexableType for u16 { }
878
888
impl IndexableType for u8 { }
0 commit comments