@@ -153,7 +153,10 @@ mul_wirtinger(a, b::Wirtinger) = Wirtinger(mul(a, b.primal), mul(a, b.conjugate)
153
153
# ####
154
154
155
155
"""
156
- TODO
156
+ Casted(v)
157
+
158
+ This differential wraps another differential (including a number-like type)
159
+ to indicate that it should be lazily broadcast.
157
160
"""
158
161
struct Casted{V} <: AbstractDifferential
159
162
value:: V
@@ -184,11 +187,13 @@ mul_casted(a, b::Casted) = Casted(broadcasted(mul, a, b.value))
184
187
# ####
185
188
186
189
"""
187
- TODO
190
+ Zero()
191
+ The additive identity for differentials.
192
+ This is basically the same as `0`.
188
193
"""
189
194
struct Zero <: AbstractDifferential end
190
195
191
- extern (x:: Zero ) = false
196
+ extern (x:: Zero ) = false # false is a strong 0. E.g. `false * NaN = 0.0`
192
197
193
198
Base. Broadcast. broadcastable (:: Zero ) = Ref (Zero ())
194
199
@@ -208,7 +213,11 @@ mul_zero(::Any, ::Zero) = Zero()
208
213
# ####
209
214
210
215
"""
211
- TODO
216
+ DNE()
217
+
218
+ This differential indicates that the derivative Does Not Exist (D.N.E).
219
+ This is not the cast that it is not implemented, but rather that it mathematically
220
+ is not defined.
212
221
"""
213
222
struct DNE <: AbstractDifferential end
214
223
@@ -232,11 +241,13 @@ mul_dne(::Any, ::DNE) = DNE()
232
241
# ####
233
242
234
243
"""
235
- TODO
244
+ One()
245
+ The Differential which is the multiplicative identity.
246
+ Basically, this represents `1`.
236
247
"""
237
248
struct One <: AbstractDifferential end
238
249
239
- extern (x:: One ) = true
250
+ extern (x:: One ) = true # true is a strong 1.
240
251
241
252
Base. Broadcast. broadcastable (:: One ) = Ref (One ())
242
253
@@ -256,7 +267,9 @@ mul_one(a, ::One) = a
256
267
# ####
257
268
258
269
"""
259
- TODO
270
+ Thunk(()->v)
271
+ A thunk is a deferred computation.
272
+ It wraps a zero argument closure that when invoked returns a differential.
260
273
"""
261
274
struct Thunk{F} <: AbstractDifferential
262
275
f:: F
0 commit comments