Skip to content

Commit 4bf2b03

Browse files
Use same_kind casting
1 parent 4975148 commit 4bf2b03

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

dpnp/dpnp_iface_mathematical.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2888,16 +2888,18 @@ def interp(x, xp, fp, left=None, right=None, period=None):
28882888
usm_type, exec_q = get_usm_allocations([x, xp, fp])
28892889

28902890
x_float_type = dpnp.default_float_type(exec_q)
2891-
x = dpnp.astype(x, x_float_type, order="C", casting="safe", copy=False)
2892-
xp = dpnp.astype(xp, x_float_type, order="C", casting="safe", copy=False)
2891+
x = dpnp.astype(x, x_float_type, order="C", casting="same_kind", copy=False)
2892+
xp = dpnp.astype(
2893+
xp, x_float_type, order="C", casting="same_kind", copy=False
2894+
)
28932895

28942896
if fp.dtype == dpnp.bool:
28952897
# Handle bool type for `fp` to follow NumPy behavior
28962898
out_dtype = x_float_type
28972899
else:
28982900
out_dtype = dpnp.common_type(x, xp, fp)
28992901

2900-
fp = dpnp.astype(fp, out_dtype, order="C", casting="safe", copy=False)
2902+
fp = dpnp.astype(fp, out_dtype, order="C", casting="same_kind", copy=False)
29012903

29022904
if period is not None:
29032905
if not dpnp.isscalar(period):

0 commit comments

Comments
 (0)