From beebed651f8b29053ede63271bf0c5655be8d6c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Manuel=20Frutos?= Date: Mon, 24 Apr 2023 15:59:07 +0200 Subject: [PATCH] adding docu to sum! explain target should not alias with the source --- base/reducedim.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/base/reducedim.jl b/base/reducedim.jl index 101568d60002b..c1c58ccdfefed 100644 --- a/base/reducedim.jl +++ b/base/reducedim.jl @@ -525,6 +525,8 @@ sum(f, A::AbstractArray; dims) sum!(r, A) Sum elements of `A` over the singleton dimensions of `r`, and write results to `r`. +Note that since the sum! function is intended to operate without making any allocations, +the target should not alias with the source. # Examples ```jldoctest