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

full fix to #1352 #1355

Merged
merged 1 commit into from
Aug 17, 2023
Merged

full fix to #1352 #1355

merged 1 commit into from
Aug 17, 2023

Conversation

marius311
Copy link
Contributor

I did screw up #1350 slightly sorry, thanks for catching that in #1352 @frankschae, but @devmotion's #1353 is only a partial fix because the allocator ends up eltype Any. Here's a full fix. I also reduced the test (this test also would have caught the error in my initial PR).

return du[:, 1]
end
# reduced mwe of #1352
@test Zygote.gradient([0,0]) do x
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe use some more complicated function and some non-zero values? It happened to me before (eg in DistributionsAD) that too "nice" values and examples did not catch (all) problems.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, any suggestions? The test is mainly of the pullback of getindex(x::Buffer, ::UnitRange) which was not getting tested before (only getindex(x::Buffer, ::Int) was).

Copy link
Member

Choose a reason for hiding this comment

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

Gentle ping on this. If there are no good ideas then I think this is ready?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fine by me to go ahead as-is or for someone to tweak the test. Just rebased on master for convenience.

Copy link
Member

Choose a reason for hiding this comment

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

Given that eltype(x) eventually falls back to Any, I think this is pretty safe. We can always tweak the tests later if someone has a good idea on how to do so.

return du[:, 1]
end
# reduced mwe of #1352
@test Zygote.gradient([0,0]) do x
Copy link
Member

Choose a reason for hiding this comment

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

Given that eltype(x) eventually falls back to Any, I think this is pretty safe. We can always tweak the tests later if someone has a good idea on how to do so.

@ToucheSir ToucheSir merged commit d4562e3 into FluxML:master Aug 17, 2023
8 of 12 checks passed
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.

3 participants