Skip to content

Commit

Permalink
Remove find_common_type which is never used in DPNP and deprecated si…
Browse files Browse the repository at this point in the history
…nce NumPy 1.25.0 (#1742)
  • Loading branch information
antonwolfy authored Mar 13, 2024
1 parent 0769980 commit de25db0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
1 change: 0 additions & 1 deletion doc/reference/dtype.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Data type testing
dpnp.issubdtype
dpnp.issubsctype
dpnp.issubclass_
dpnp.find_common_type

Miscellaneous
-------------
Expand Down
6 changes: 0 additions & 6 deletions dpnp/dpnp_utils/dpnp_algo_utils.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@ Returns a tuple of:
2. dtype
"""

cpdef find_common_type(object x1_obj, object x2_obj)
"""
Find common type of 2 input objects
"""


cpdef long _get_linear_index(key, tuple shape, int ndim)
"""
Compute linear index of an element in memory from array indices
Expand Down
20 changes: 0 additions & 20 deletions dpnp/dpnp_utils/dpnp_algo_utils.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -432,26 +432,6 @@ cdef tuple get_shape_dtype(object input_obj):
return (return_shape, dpnp.dtype(type(input_obj)))


cpdef find_common_type(object x1_obj, object x2_obj):
_, x1_dtype = get_shape_dtype(x1_obj)
_, x2_dtype = get_shape_dtype(x2_obj)

cdef list array_types = []
cdef list scalar_types = []

if dpnp.isscalar(x1_obj):
scalar_types.append(x1_dtype)
else:
array_types.append(x1_dtype)

if dpnp.isscalar(x2_obj):
scalar_types.append(x2_dtype)
else:
array_types.append(x2_dtype)

return numpy.find_common_type(array_types, scalar_types)


cdef shape_type_c get_common_shape(shape_type_c input1_shape, shape_type_c input2_shape) except *:
cdef shape_type_c input1_shape_orig = input1_shape
cdef shape_type_c input2_shape_orig = input2_shape
Expand Down

0 comments on commit de25db0

Please sign in to comment.