Thanks! I tried the following
using StatsFuns: logsumexp
function logsumexp(A::AbstractArray, Dims)
return mapslices(logsumexp, A, Dims)
function test1(u, N)
for _ in 1:N
l = logsumexp(u, 2)
u = ones((10, 100000))
v = ones((100000, 10))
@time (test1(v, 1000))
The 1st benchmark is very good, timing identical to scipy logsumexp.
But the 2nd benchmark is much slower, about 4x slower than scipy!
I didn't see how to use reducedim here, as it says it wants a binary function, and my logsumexp is n-ary.