Skip to content

Commit 9749b63

Browse files
committed
DArray: Improve norm2 inference
1 parent 1816efd commit 9749b63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/array/linalg.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function LinearAlgebra.norm2(A::DArray{T,2}) where T
22
Ac = A.chunks
3-
norms = [Dagger.@spawn mapreduce(LinearAlgebra.norm_sqr, +, chunk) for chunk in Ac]
4-
return sqrt(sum(map(fetch, norms)))
3+
norms = [Dagger.@spawn mapreduce(LinearAlgebra.norm_sqr, +, chunk) for chunk in Ac]::Matrix{DTask}
4+
return sqrt(sum(map(norm->fetch(norm)::real(T), norms)))
55
end
66
function LinearAlgebra.norm2(A::UpperTriangular{T,<:DArray{T,2}}) where T
77
Ac = parent(A).chunks

0 commit comments

Comments
 (0)