@@ -1319,7 +1319,8 @@ def common_type(*arrays):
13191319 The return type will always be an inexact (i.e. floating point or complex)
13201320 scalar type, even if all the arrays are integer arrays.
13211321 If one of the inputs is an integer array, the minimum precision type
1322- that is returned is determined by the device capabilities.
1322+ that is returned is the default floating point data type for the device
1323+ where the input arrays are allocated.
13231324
13241325 For full documentation refer to :obj:`numpy.common_type`.
13251326
@@ -1339,9 +1340,9 @@ def common_type(*arrays):
13391340 >>> np.common_type(np.arange(2, dtype=np.float32))
13401341 numpy.float32
13411342 >>> np.common_type(np.arange(2, dtype=np.float32), np.arange(2))
1342- numpy.float64
1343+ numpy.float64 # may vary
13431344 >>> np.common_type(np.arange(4), np.array([45, 6.j]), np.array([45.0]))
1344- numpy.complex128
1345+ numpy.complex128 # may vary
13451346
13461347 """
13471348
@@ -1358,9 +1359,9 @@ def common_type(*arrays):
13581359 default_float_dtype = dpnp .default_float_type (sycl_queue = exec_q )
13591360 dtypes = []
13601361 for a in arrays :
1361- if a .dtype . kind == "b" :
1362+ if not dpnp . issubdtype ( a .dtype , dpnp . number ) :
13621363 raise TypeError ("can't get common type for non-numeric array" )
1363- if a .dtype . kind in "iu" :
1364+ if dpnp . issubdtype ( a .dtype , dpnp . integer ) :
13641365 dtypes .append (default_float_dtype )
13651366 else :
13661367 dtypes .append (a .dtype )
0 commit comments