Skip to content

Commit

Permalink
Merge #389
Browse files Browse the repository at this point in the history
389: Add tests for sum with closed over variable and generator. Issue #231 r=MikeInnes a=baggepinnen



Co-authored-by: Fredrik Bagge Carlson <[email protected]>
  • Loading branch information
bors[bot] and baggepinnen authored Nov 4, 2019
2 parents 152fbdd + 472332d commit dcdc4fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/gradcheck.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ Random.seed!(0)
@test gradtest(x -> sum(x, dims = (2, 3)), (3,4,5))
@test gradtest(x -> sum(abs2, x), randn(4, 3, 2))
@test gradtest(x -> sum(abs2, x; dims=1), randn(4, 3, 2))
@test gradtest(x -> sum(x[i] for i in 1:length(x)), randn(10))
@test_broken gradtest(x -> sum(i->x[i], 1:length(x)), randn(10)) # https://github.com/FluxML/Zygote.jl/issues/231

@test_broken gradtest(x -> prod(x, dims = (2, 3)), (3,4,5))
@test gradtest(x -> prod(x), (3,4,5))

Expand Down

0 comments on commit dcdc4fa

Please sign in to comment.