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

Always call reverse in map #1376

Merged
merged 2 commits into from
Feb 17, 2023
Merged

Always call reverse in map #1376

merged 2 commits into from
Feb 17, 2023

Conversation

mcabbott
Copy link
Member

Fixes #1374 by removing the special case that _tryreverse only reverses vectors & tuples.

Possibly it will now fail on other types. That's better than silently failing to reverse them.

Copy link
Member

@ToucheSir ToucheSir left a comment

Choose a reason for hiding this comment

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

Downstream tests pass so I'm happy modulo small comment change. If we end up falling victim to Hyrum's law so be it, probably good to know than to be ignorant anyhow. One wonders how many correctness demons like this are lurking in the depths of Zygote's less well-trodden rules...

src/lib/array.jl Outdated
Comment on lines 169 to 170
# That lead to https://github.com/FluxML/Zygote.jl/issues/1374
# ... and post-1.6 dims is not required to reverse arrays.
Copy link
Member

Choose a reason for hiding this comment

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

How about amending the above comment instead? As noted it turned stale the moment we set min compat to 1.6.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've shrunk the comment. Not sure what the right policy is for pmap, but I haven't changed it.

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.

Incorrect gradient with comprehensions
2 participants