Skip to content

Commit

Permalink
Merge pull request #71 from JuliaDiff/ox/nofieldsiszero
Browse files Browse the repository at this point in the history
use Zero rather than DoesNotExist for NO_FIELDS
  • Loading branch information
oxinabox authored Jan 10, 2020
2 parents e5e877b + c3a30b9 commit b9abd85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/differentials/composite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,4 @@ Constant for the reverse-mode derivative with respect to a structure that has no
The most notable use for this is for the reverse-mode derivative with respect to the
function itself, when that function is not a closure.
"""
const NO_FIELDS = DoesNotExist()
const NO_FIELDS = Zero()
4 changes: 4 additions & 0 deletions test/differentials/composite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,8 @@ end
@test (@allocated ChainRulesCore.elementwise_add(bk, bk)) <= 48
end
end

@testset "NO_FIELDS" begin
@test NO_FIELDS === Zero()
end
end

0 comments on commit b9abd85

Please sign in to comment.