11"""
22 AbstractZero <: AbstractDifferential
33
4- This is zero-like differential types.
5- If a AD system encounter a propagator taking as input only subtypes of `AbstractZero` then
6- it can stop performing any AD operations, as all propagator are linear functions, and thus
4+ This abstract type encompasses zero-like differential types.
5+ If an AD system encounters a propagator that takes as input only subtypes of `AbstractZero`,
6+ then it can stop performing AD operations. All propagators are linear functions, and thus
77the final result will be zero.
88
99All `AbstractZero` subtypes are singleton types.
10- There are two of them [`Zero()`](@ref) and [`DoesNotExist()`](@ref).
10+ There are two of them: [`Zero()`](@ref) and [`DoesNotExist()`](@ref).
1111"""
1212abstract type AbstractZero <: AbstractDifferential end
1313Base. iszero (:: AbstractZero ) = true
@@ -28,7 +28,7 @@ Base.:/(z::AbstractZero, ::Any) = z
2828
2929The additive identity for differentials.
3030This is basically the same as `0`.
31- A derivative of `Zero()`. does not propagate through the primal function.
31+ A derivative of `Zero()` does not propagate through the primal function.
3232"""
3333struct Zero <: AbstractZero end
3434
@@ -43,21 +43,21 @@ Base.zero(::Type{<:AbstractDifferential}) = Zero()
4343 DoesNotExist() <: AbstractZero
4444
4545This differential indicates that the derivative does not exist.
46- It is the differential for a Primal type that is not differentiable.
47- Such an Integer, or Boolean (when not being used as a represention of a value that normally
48- would be a floating point.)
49- The only valid way to pertube such a values is to not change it at all.
50- As such , `DoesNotExist` is functionally identical to `Zero()`,
51- but provides additional semantic information.
46+ It is the differential for primal types that are not differentiable,
47+ such as integers or booleans (when they are not being used to represent
48+ floating- point values).
49+ The only valid way to perturb such values is to not change them at all.
50+ As a consequence , `DoesNotExist` is functionally identical to `Zero()`,
51+ but it provides additional semantic information.
5252
53- If you are adding this differential to a primal then something is wrong.
54- A optimization package making use of this might like to check for such a case.
53+ If you are adding this differential to a primal, then something is wrong.
54+ An optimization package making use of this might want to check for such a case.
5555
5656!!! note:
57- This does not indicate that the derivative it is not implemented,
57+ This does not indicate that the derivative is not implemented,
5858 but rather that mathematically it is not defined.
5959
60- This mostly shows up as the deriviative with respect to dimension, index, or size
60+ This mostly shows up as the derivative with respect to dimension, index, or size
6161arguments.
6262```
6363 function rrule(fill, x, len::Int)
0 commit comments