@@ -341,7 +341,7 @@ impl HasAfEnum for f16 {
341
341
type AbsOutType = Self ;
342
342
type ArgOutType = Self ;
343
343
type UnaryOutType = Self ;
344
- type ComplexOutType = Complex < f16 > ;
344
+ type ComplexOutType = Complex < f32 > ;
345
345
type MeanOutType = Self ;
346
346
type AggregateOutType = f32 ;
347
347
type ProductOutType = f32 ;
@@ -682,12 +682,18 @@ impl FloatingPoint for f32 {
682
682
true
683
683
}
684
684
}
685
+ impl FloatingPoint for f16 {
686
+ fn is_real ( ) -> bool {
687
+ true
688
+ }
689
+ }
685
690
686
691
///Trait qualifier to accept real data(numbers)
687
692
pub trait RealFloating : HasAfEnum { }
688
693
689
694
impl RealFloating for f64 { }
690
695
impl RealFloating for f32 { }
696
+ impl RealFloating for f16 { }
691
697
692
698
///Trait qualifier to accept complex data(numbers)
693
699
pub trait ComplexFloating : HasAfEnum { }
@@ -700,6 +706,7 @@ pub trait RealNumber: HasAfEnum {}
700
706
701
707
impl RealNumber for f64 { }
702
708
impl RealNumber for f32 { }
709
+ impl RealNumber for f16 { }
703
710
impl RealNumber for i32 { }
704
711
impl RealNumber for u32 { }
705
712
impl RealNumber for i16 { }
@@ -860,6 +867,8 @@ impl Fromf64 for u32 { fn fromf64(value: f64) -> Self { value as Self }}
860
867
#[ rustfmt:: skip]
861
868
impl Fromf64 for i32 { fn fromf64 ( value : f64 ) -> Self { value as Self } }
862
869
#[ rustfmt:: skip]
870
+ impl Fromf64 for f16 { fn fromf64 ( value : f64 ) -> Self { f16:: from_f64 ( value) } }
871
+ #[ rustfmt:: skip]
863
872
impl Fromf64 for u16 { fn fromf64 ( value : f64 ) -> Self { value as Self } }
864
873
#[ rustfmt:: skip]
865
874
impl Fromf64 for i16 { fn fromf64 ( value : f64 ) -> Self { value as Self } }
@@ -877,6 +886,7 @@ impl IndexableType for u64 {}
877
886
impl IndexableType for f32 { }
878
887
impl IndexableType for i32 { }
879
888
impl IndexableType for u32 { }
889
+ impl IndexableType for f16 { }
880
890
impl IndexableType for i16 { }
881
891
impl IndexableType for u16 { }
882
892
impl IndexableType for u8 { }
0 commit comments