File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -322,15 +322,16 @@ def accumulation_result_dtype(x_dtype, dtype_kwarg):
322
322
default_float = xp .asarray (float ()).dtype
323
323
if default_float not in real_float_dtypes :
324
324
warn (f"inferred default float is { default_float !r} , which is not a float" )
325
- if api_version > "2021.12" :
325
+
326
+ if not (hasattr (xp , "complex32" ) or hasattr (xp , "complex64" )):
327
+ default_complex = None
328
+ else :
326
329
default_complex = xp .asarray (complex ()).dtype
327
330
if default_complex not in complex_dtypes :
328
331
warn (
329
332
f"inferred default complex is { default_complex !r} , "
330
333
"which is not a complex"
331
334
)
332
- else :
333
- default_complex = None
334
335
335
336
if dtype_nbits [default_int ] == 32 :
336
337
default_uint = _name_to_dtype .get ("uint32" )
You can’t perform that action at this time.
0 commit comments