Skip to content

Commit 6b3f331

Browse files
Apply remarks for _utils.py
1 parent 01078bf commit 6b3f331

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

dpnp/scipy/linalg/_utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,6 @@ def _batched_lu_solve(lu, piv, b, res_type, trans=0):
215215
"""Solve a batched equation system (SciPy-compatible behavior)."""
216216
res_usm_type, exec_q = get_usm_allocations([lu, piv, b])
217217

218-
if b.size == 0:
219-
return dpnp.empty_like(b, dtype=res_type, usm_type=res_usm_type)
220-
221218
b_ndim = b.ndim
222219

223220
lu, b = _align_lu_solve_broadcast(lu, b)
@@ -257,7 +254,7 @@ def _batched_lu_solve(lu, piv, b, res_type, trans=0):
257254
_manager = dpu.SequentialOrderManager[exec_q]
258255
dep_evs = _manager.submitted_events
259256

260-
# oneMKL LAPACK getrs overwrites `lu`.
257+
# oneMKL LAPACK getrs_batch overwrites `lu`
261258
lu_h = dpnp.empty_like(lu, order="F", dtype=res_type, usm_type=res_usm_type)
262259

263260
# use DPCTL tensor function to fill the сopy of the input array
@@ -270,6 +267,8 @@ def _batched_lu_solve(lu, piv, b, res_type, trans=0):
270267
)
271268
_manager.add_event_pair(ht_ev, lu_copy_ev)
272269

270+
# oneMKL LAPACK getrs_batch overwrites `b` and assumes fortran-like array
271+
# as input
273272
b_h = dpnp.empty_like(b, order="F", dtype=res_type, usm_type=res_usm_type)
274273
ht_ev, b_copy_ev = ti._copy_usm_ndarray_into_usm_ndarray(
275274
src=b_usm_arr,

0 commit comments

Comments
 (0)