Distributed versions of mapslice

I found julia awfully lacking in terms of operations among/along specific axis/axes of matrix/tensors. It has been extremely annoying that there is no “dims” argument for sum, reduce, mean, prod, etc… The only option for this is mapslice but there is also no parallel version for it. It seems only way around it is just to initialize a SharedArray and do a @distributed for manually, which is just extra syntax.

:confused:

julia> sum(ones(3, 3); dims = 1)
1×3 Array{Float64,2}:
 3.0  3.0  3.0

You may also find

In don’t see why it cannot be pmaped, but haven’t tried it myself.

2 Likes