-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]collectionsData structures holding multiple items, e.g. setsData structures holding multiple items, e.g. setsfoldsum, maximum, reduce, foldl, etc.sum, maximum, reduce, foldl, etc.
Description
A = rand(3,4)
sum(I -> A[I], CartesianIndices(A); dims=1) # ERROR: BoundsError: attempt to access 3×4 Matrix{Float64} at index [0, 0]
sum(I -> A[I], CartesianIndices(A); dims=1, init=0.) # now it works
I'm running the following version:
julia> versioninfo()
Julia Version 1.10.4
Commit 48d4fd4 (2024-06-04 10:41 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 8 × 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, tigerlake)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)
Metadata
Metadata
Assignees
Labels
arrays[a, r, r, a, y, s][a, r, r, a, y, s]collectionsData structures holding multiple items, e.g. setsData structures holding multiple items, e.g. setsfoldsum, maximum, reduce, foldl, etc.sum, maximum, reduce, foldl, etc.