Skip to content

Commit 3d9db1c

Browse files
committed
Make keyword-only parameters and align names
1 parent b6cc5fe commit 3d9db1c

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

dpnp/dpnp_iface.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,13 @@ def asnumpy(a, order="C"):
209209

210210

211211
# pylint: disable=redefined-outer-name
212-
def astype(x1, dtype, order="K", casting="unsafe", copy=True, device=None):
212+
def astype(x, dtype, /, *, order="K", casting="unsafe", copy=True, device=None):
213213
"""
214214
Copy the array with data type casting.
215215
216216
Parameters
217217
----------
218-
x1 : {dpnp.ndarray, usm_ndarray}
218+
x : {dpnp.ndarray, usm_ndarray}
219219
Array data type casting.
220220
dtype : {None, str, dtype object}
221221
Target data type.
@@ -262,15 +262,15 @@ def astype(x1, dtype, order="K", casting="unsafe", copy=True, device=None):
262262
if order is None:
263263
order = "K"
264264

265-
x1_obj = dpnp.get_usm_ndarray(x1)
266-
array_obj = dpt.astype(
267-
x1_obj, dtype, order=order, casting=casting, copy=copy, device=device
265+
usm_x = dpnp.get_usm_ndarray(x)
266+
usm_res = dpt.astype(
267+
usm_x, dtype, order=order, casting=casting, copy=copy, device=device
268268
)
269269

270-
if array_obj is x1_obj and isinstance(x1, dpnp_array):
271-
# return x1 if dpctl returns a zero copy of x1_obj
272-
return x1
273-
return dpnp_array._create_from_usm_ndarray(array_obj)
270+
if usm_res is usm_x and isinstance(x, dpnp_array):
271+
# return x if dpctl returns a zero copy of usm_x
272+
return x
273+
return dpnp_array._create_from_usm_ndarray(usm_res)
274274

275275

276276
def as_usm_ndarray(a, dtype=None, device=None, usm_type=None, sycl_queue=None):

0 commit comments

Comments
 (0)