Skip to content

Commit f782d1c

Browse files
committed
Use _cast_fill_val private function from dpctl.tensor._ctors
1 parent 478397f commit f782d1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dpnp/dpnp_algo/dpnp_fill.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
import dpctl.tensor as dpt
2828
import dpctl.utils as dpu
29-
import numpy as np
29+
from dpctl.tensor._ctors import _cast_fill_val
3030
from dpctl.tensor._tensor_impl import (
3131
_copy_usm_ndarray_into_usm_ndarray,
3232
_full_usm_ndarray,
@@ -70,7 +70,7 @@ def dpnp_fill(arr, val):
7070
elif val_type is complex and dpnp.issubdtype(dt, dpnp.floating):
7171
val = val.real
7272
elif val_type is int and dpnp.issubdtype(dt, dpnp.integer):
73-
val = np.asarray(val, dtype=dt)[()]
73+
val = _cast_fill_val(val, dt)
7474

7575
_manager = dpu.SequentialOrderManager[exec_q]
7676
dep_evs = _manager.submitted_events

0 commit comments

Comments
 (0)