-
Notifications
You must be signed in to change notification settings - Fork 93
Fix errors revealed by Zygote's tests #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2b68194
d922dc6
fa59860
d4c8fb4
3d58d3d
726c7dc
2b4394b
80da894
0f8702c
6d53400
12ebc7d
b4f8f77
bebd13e
cc03193
6de5f24
f859350
5fe0947
11d3610
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,15 @@ | |
##### | ||
|
||
function rrule(::Type{<:Diagonal}, d::AbstractVector) | ||
function Diagonal_pullback(ȳ) | ||
return (NO_FIELDS, @thunk(diag(ȳ))) | ||
function Diagonal_pullback(ȳ::AbstractMatrix) | ||
return (NO_FIELDS, diag(ȳ)) | ||
end | ||
function Diagonal_pullback(ȳ::Composite) | ||
# TODO: Assert about the primal type in the Composite, It should be Diagonal | ||
# infact it should be exactly the type of `Diagonal(d)` | ||
# but right now Zygote loses primal type information so we can't use it. | ||
# See https://github.com/FluxML/Zygote.jl/issues/603 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i am confused by this: how do we end up with a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because in the Zygote PR we turn all |
||
return (NO_FIELDS, ȳ.diag) | ||
end | ||
return Diagonal(d), Diagonal_pullback | ||
end | ||
|
Uh oh!
There was an error while loading. Please reload this page.