Skip to content

Commit 03c2e1d

Browse files
cdluminateKristofferC
authored andcommitted
Workaround subarray test failure due to associativity. (#29386)
| subarray: Test Failed at /usr/share/julia/test/subarray.jl:611 | Expression: #= /usr/share/julia/test/subarray.jl:611 =# @inferred(sum(Base.unaliascopy(V))) == sum(V) == sum(A[2:5, :, 2:5, 1:2:5]) | Evaluated: 121.8579669083425 == 121.8579669083425 == 121.85796690834263 A = rand(5,5,5,5) V = view(A, 2:5, :, 2:5, 1:2:5) @code_typed sum(V) # calls mapfoldl @code_typed sum(A[2:5, :, 2:5, 1:2:5]) # calls mapreduce mapreduce doesn't guarantee the associativity, which is likely the cause of this precision issue in random sum. (cherry picked from commit 518f548)
1 parent 3a7892f commit 03c2e1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/subarray.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ V = view(A, 1:1 ,:, 1:3, :)
608608
A = rand(5,5,5,5)
609609
V = view(A, 2:5, :, 2:5, 1:2:5)
610610
@test @inferred(Base.unaliascopy(V)) == V == A[2:5, :, 2:5, 1:2:5]
611-
@test @inferred(sum(Base.unaliascopy(V))) == sum(V) == sum(A[2:5, :, 2:5, 1:2:5])
611+
@test @inferred(sum(Base.unaliascopy(V))) sum(V) sum(A[2:5, :, 2:5, 1:2:5])
612612

613613
# issue #27632
614614
function _test_27632(A)

0 commit comments

Comments
 (0)