Skip to content

Commit

Permalink
Return stray return and fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Mar 31, 2020
1 parent dd8c594 commit cb79e08
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/testsuite/mapreduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ function test_mapreduce(AT)
@test compare((A,R)->Base.mapreducedim!(identity, +, R, A), AT, rand(range, sz), zeros(ET, red))
@test compare((A,R)->Base.mapreducedim!(identity, *, R, A), AT, rand(range, sz), ones(ET, red))
@test compare((A,R)->Base.mapreducedim!(x->x+x, +, R, A), AT, rand(range, sz), zeros(ET, red))
return
end

# implicit singleton dimensions
Expand Down Expand Up @@ -141,14 +140,14 @@ function test_mapreduce(AT)
@test compare(x->mapreduce(_addone, +, x; dims = 2, init = _zero),
AT, rand(range, N, N))

@test compare(x->mapreduce(+, +, x; dims = 2),
@test compare((x,y)->mapreduce(+, +, x, y; dims = 2),
AT, rand(range, N, N), rand(range, N, N))
@test compare((x,y)->mapreduce(+, +, x, y; dims = 2, init = _zero),
AT, rand(range, N, N), rand(range, N, N))
@test compare(x->mapreduce(+, +, x; dims = 2, init = _zero),
AT, rand(range, N, N). rand(range, N, N))
end
end
@testset "sum maximum minimum prod" begin
for dims in ((4048,), (1024,1024), (77,), (1923,209))
for dims in ((4048,), (77,), (1923,209))
@test compare(sum, AT, rand(range, dims))
@test compare(prod, AT, rand(range, dims))
@test compare(x -> sum(abs, x), AT, rand(range, dims))
Expand Down

0 comments on commit cb79e08

Please sign in to comment.