You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/converting_zygoterules.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,9 @@ end
38
38
No magic macro here, `rrule` is the function that it is.
39
39
The function it is the rule for is the first argument, or second argument if you need to take a `[RuleConfig`](@ref).
40
40
41
+
Note that when writing the rule for constructor you will need to use `::Type{Foo}`, not `typeof(Foo)`.
42
+
See docs on [Constructors](@ref).
43
+
41
44
## Include the derivative with respect to the function object itself
42
45
The `ZygoteRules.@adjoint` macro automagically[^1] inserts a extra `nothing` in the return for the function it generates to represent the derivative of output with respect to the function object.
43
46
ChainRules as a philosophy avoids magic as much as possible, and thus require you to return it explicitly.
0 commit comments