Skip to content

Commit 913e8be

Browse files
authored
remove container specific type from find_common_type() (#881)
1 parent 0821a17 commit 913e8be

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

dpnp/dpnp_utils/dpnp_algo_utils.pyx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -286,24 +286,21 @@ cdef tuple get_shape_dtype(object input_obj):
286286

287287

288288
cpdef find_common_type(object x1_obj, object x2_obj):
289-
cdef bint x1_obj_is_dparray = isinstance(x1_obj, dparray)
290-
cdef bint x2_obj_is_dparray = isinstance(x2_obj, dparray)
291-
292289
_, x1_dtype = get_shape_dtype(x1_obj)
293290
_, x2_dtype = get_shape_dtype(x2_obj)
294291

295292
cdef list array_types = []
296293
cdef list scalar_types = []
297294

298-
if x1_obj_is_dparray:
299-
array_types.append(x1_dtype)
300-
else:
295+
if dpnp.isscalar(x1_obj):
301296
scalar_types.append(x1_dtype)
302-
303-
if x2_obj_is_dparray:
304-
array_types.append(x2_dtype)
305297
else:
298+
array_types.append(x1_dtype)
299+
300+
if dpnp.isscalar(x2_obj):
306301
scalar_types.append(x2_dtype)
302+
else:
303+
array_types.append(x2_dtype)
307304

308305
return numpy.find_common_type(array_types, scalar_types)
309306

0 commit comments

Comments
 (0)