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):
322322 default_float = xp .asarray (float ()).dtype
323323 if default_float not in real_float_dtypes :
324324 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 :
326329 default_complex = xp .asarray (complex ()).dtype
327330 if default_complex not in complex_dtypes :
328331 warn (
329332 f"inferred default complex is { default_complex !r} , "
330333 "which is not a complex"
331334 )
332- else :
333- default_complex = None
334335
335336if dtype_nbits [default_int ] == 32 :
336337 default_uint = _name_to_dtype .get ("uint32" )
You can’t perform that action at this time.
0 commit comments