File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -687,7 +687,8 @@ cdef class usm_ndarray:
687
687
""" Returns real component for arrays with complex data-types
688
688
and returns itself for all other data-types.
689
689
"""
690
- if (self .typenum_ < UAR_CFLOAT):
690
+ # explicitly check for UAR_HALF, which is greater than UAR_CFLOAT
691
+ if (self .typenum_ < UAR_CFLOAT or self .typenum_ == UAR_HALF):
691
692
# elements are real
692
693
return self
693
694
if (self .typenum_ < UAR_TYPE_SENTINEL):
@@ -698,7 +699,8 @@ cdef class usm_ndarray:
698
699
""" Returns imaginary component for arrays with complex data-types
699
700
and returns zero array for all other data-types.
700
701
"""
701
- if (self .typenum_ < UAR_CFLOAT):
702
+ # explicitly check for UAR_HALF, which is greater than UAR_CFLOAT
703
+ if (self .typenum_ < UAR_CFLOAT or self .typenum_ == UAR_HALF):
702
704
# elements are real
703
705
return _zero_like(self )
704
706
if (self .typenum_ < UAR_TYPE_SENTINEL):
You can’t perform that action at this time.
0 commit comments