Skip to content

Commit a8b6236

Browse files
committed
clarify DoesNotExist
1 parent 68f00c4 commit a8b6236

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/differentials/abstract_zero.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"""
22
AbstractZero <: AbstractDifferential
33
4-
This abstract type encompasses zero-like differential types.
4+
Supertype of zero-like differentials—i.e., differentials that act like zero when
5+
added or multiplied to other values.
56
If an AD system encounters a propagator that takes as input only subtypes of `AbstractZero`,
67
then it can stop performing AD operations. All propagators are linear functions, and thus
78
the final result will be zero.
@@ -50,7 +51,8 @@ The only valid way to perturb such values is to not change them at all.
5051
As a consequence, `DoesNotExist` is functionally identical to `Zero()`,
5152
but it provides additional semantic information.
5253
53-
If you are adding this differential to a primal, then something is wrong.
54+
Adding this differential to a primal is intrinsically wrong: gradient-based
55+
methods cannot be used to optimize over discrete variables.
5456
An optimization package making use of this might want to check for such a case.
5557
5658
!!! note:

0 commit comments

Comments
 (0)