Skip to content
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

Fix errors revealed by Zygote's tests #175

Merged
merged 18 commits into from
Apr 29, 2020
Merged

Fix errors revealed by Zygote's tests #175

merged 18 commits into from
Apr 29, 2020

Conversation

oxinabox
Copy link
Member

@oxinabox oxinabox commented Apr 20, 2020

Found these because of Zygote's tests
while working on FluxML/Zygote.jl#366

It is hard to add tests for them because they are about testing that
we didn't define a rule we should not have,
and that we don't thunk to many times

@willtebbutt
Copy link
Member

Seems unlikely. Note this issue on FiniteDifferences. This PR aims to fix it.

@oxinabox
Copy link
Member Author

Ok this is ready for review though it needs the fix in TestUtils before tests will run

@oxinabox
Copy link
Member Author

Once we have JuliaDiff/ChainRulesTestUtils.jl#25
this is good to go.
(I tested and it passes on that branch)

Copy link
Contributor

@nickrobinson251 nickrobinson251 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once test pass, LGTM

src/rulesets/LinearAlgebra/dense.jl Outdated Show resolved Hide resolved
src/rulesets/Base/base.jl Show resolved Hide resolved
src/rulesets/Base/base.jl Show resolved Hide resolved
src/rulesets/LinearAlgebra/dense.jl Show resolved Hide resolved
# 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am confused by this: how do we end up with a Composite but not a Composite{P} for the correct P?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because in the Zygote PR we turn all NamedTuples into Composite{Any}

test/rulesets/LinearAlgebra/structured.jl Outdated Show resolved Hide resolved
@willtebbutt
Copy link
Member

Cross referencing this -- I'm not sure why abs2 doesn't work for complex numbers, but I can see why our current implementation of abs doesn't work.

@oxinabox oxinabox merged commit df431b9 into master Apr 29, 2020
@oxinabox oxinabox deleted the ox/zygote_fixes branch April 29, 2020 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants