Skip to content

Commit 34aa37c

Browse files
Add a more efficient implementation
1 parent 7f03075 commit 34aa37c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

dpnp/linalg/dpnp_utils_linalg.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,9 @@ def dpnp_pinv(a, rcond=1e-15, hermitian=False):
10341034
dpnp.reciprocal(s, out=s)
10351035
s[leq] = 0
10361036

1037-
return dpnp.matmul(vt.swapaxes(-2, -1), s[..., None] * u.swapaxes(-2, -1))
1037+
u = u.swapaxes(-2, -1)
1038+
dpnp.multiply(s[..., None], u, out=u)
1039+
return dpnp.matmul(vt.swapaxes(-2, -1), u)
10381040

10391041

10401042
def dpnp_qr_batch(a, mode="reduced"):

0 commit comments

Comments
 (0)