Skip to content

Commit 6bf4854

Browse files
committed
revert Diagonal to diagm for svd with gpuarrays
1 parent 978ae49 commit 6bf4854

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/implementations/svd.jl

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ function svd_full!(A::AbstractMatrix, USVᴴ, alg::GPU_SVDAlgorithm)
356356

357357
return USVᴴ
358358
end
359-
svd_full!(A::Diagonal, USVᴴ, alg::GPU_SVDAlgorithm) = svd_full!(diagm(A.diag), USVᴴ, alg)
360359

361360
function svd_trunc!(A::AbstractMatrix, USVᴴ, alg::TruncatedAlgorithm{<:GPU_Randomized})
362361
check_input(svd_trunc!, A, USVᴴ, alg.alg)
@@ -374,7 +373,6 @@ function svd_trunc!(A::AbstractMatrix, USVᴴ, alg::TruncatedAlgorithm{<:GPU_Ran
374373

375374
return Utr, Str, Vᴴtr, ϵ
376375
end
377-
svd_trunc!(A::Diagonal, USVᴴ, alg::GPU_SVDAlgorithm) = svd_trunc!(diagm(A.diag), USVᴴ, alg)
378376

379377
function svd_compact!(A::AbstractMatrix, USVᴴ, alg::GPU_SVDAlgorithm)
380378
check_input(svd_compact!, A, USVᴴ, alg)
@@ -398,7 +396,6 @@ function svd_compact!(A::AbstractMatrix, USVᴴ, alg::GPU_SVDAlgorithm)
398396

399397
return USVᴴ
400398
end
401-
svd_compact!(A::Diagonal, USVᴴ, alg::GPU_SVDAlgorithm) = svd_compact!(diagm(A.diag), USVᴴ, alg)
402399
_argmaxabs(x) = reduce(_largest, x; init = zero(eltype(x)))
403400
_largest(x, y) = abs(x) < abs(y) ? y : x
404401

@@ -421,10 +418,3 @@ function svd_vals!(A::AbstractMatrix, S, alg::GPU_SVDAlgorithm)
421418

422419
return S
423420
end
424-
function svd_vals!(A::Diagonal, S, alg::GPU_SVDAlgorithm)
425-
check_input(svd_vals!, A, S, alg)
426-
Ad = diagview(A)
427-
S .= abs.(Ad)
428-
sort!(S; rev = true)
429-
return S
430-
end

0 commit comments

Comments
 (0)