Skip to content

Commit ab6e264

Browse files
committed
DArray: Always return Array from collect
1 parent 656c13b commit ab6e264

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/array/darray.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function Base.collect(d::DArray{T,N}; tree=false, copyto=false) where {T,N}
194194
if tree
195195
collect(fetch(treereduce_nd(map(x -> ((args...,) -> Dagger.@spawn x(args...)) , dimcatfuncs), a.chunks)))
196196
else
197-
treereduce_nd(dimcatfuncs, asyncmap(fetch, a.chunks))
197+
collect(treereduce_nd(dimcatfuncs, asyncmap(fetch, a.chunks)))
198198
end
199199
end
200200
Array{T,N}(A::DArray{S,N}) where {T,N,S} = convert(Array{T,N}, collect(A))

src/array/map-reduce.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ _mapreduce_maybesync(f, op_inner, op_outer, x, ::Colon, init) =
8686
_mapreduce_maybesync(f, op_inner, op_outer, x, nothing, init)
8787
function _mapreduce_maybesync(f, op_inner, op_outer, x::DArray{T,N}, dims::Nothing, init) where {T,N}
8888
Dx = _to_darray(MapReduce(f, op_inner, op_outer, x, dims, init))
89-
return collect(Dx)
89+
return only(collect(Dx))
9090
end
9191

9292
function Base.size(r::MapReduce)

0 commit comments

Comments
 (0)