Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kagalenko-m-b committed Jul 7, 2021
1 parent 26b7dd1 commit 38a952f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Statistics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ _mean_promote(x::T, y::S) where {T,S} = convert(promote_type(T, S), y)
_promoted_sum(f, A::AbstractArray; init, dims) = sum(x -> _mean_promote(init, f(x)), A; dims)
# calls f(A[1]) once
_promoted_sum(f, A::AbstractVector; init, dims) =
sum(x -> _mean_promote(x1, f(x)), @view A[begin+1:end]; init, dims)
sum(x -> _mean_promote(init, f(x)), @view A[begin+1:end]; init, dims)

# ::Dims is there to force specializing on Colon (as it is a Function)
function _mean(f, A::AbstractArray, dims::Dims=:) where Dims
Expand Down

0 comments on commit 38a952f

Please sign in to comment.