Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NFC: test sum(iszero, xs) #535

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions test/rulesets/Base/mapreduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,12 @@ const CFG = ChainRulesTestUtils.ADviaRuleConfig()
test_rrule(sum, sqrt, randn(5) .> 0)
test_rrule(sum, sqrt, randn(5,5) .> 0; fkwargs=(;dims=1))
# ... and Bool produced by function
# https://github.com/JuliaDiff/ChainRulesTestUtils.jl/issues/219
@test_skip test_rrule(sum, iszero, randn(5)) # DimensionMismatch("second dimension of A, 1, does not match length of x, 0")

_, pb = rrule(CFG, sum, iszero, randn(5))
@test pb(1.0) == (NoTangent(), NoTangent(), NoTangent(),)

# Functions that return a Vector
# see https://github.com/FluxML/Zygote.jl/issues/1074
test_rrule(sum, make_two_vec, [1.0, 3.0, 5.0, 7.0])
Expand Down