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

resolve rrule ambiguities #668

Merged
merged 4 commits into from
Aug 22, 2022
Merged

resolve rrule ambiguities #668

merged 4 commits into from
Aug 22, 2022

Conversation

mzgubic
Copy link
Member

@mzgubic mzgubic commented Aug 22, 2022

Closes #654

And adds a test to prevent regressions in rrule.

There are still plenty ambiguities for frule because their first arg when using @non_diff is sometimes ::Any, which produces an ambiguity with the generic RuleConfig dispatch.

@@ -54,15 +54,14 @@
@non_differentiable invperm(::AbstractArray{Bool})
@non_differentiable invpermute!(::Any, ::AbstractArray{Bool})
@non_differentiable mapslices(::Any, ::AbstractArray{Bool})
@non_differentiable Matrix(::AbstractArray{Bool})
Copy link
Member Author

Choose a reason for hiding this comment

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

this is actually taken care of in https://github.com/JuliaDiff/ChainRules.jl/blob/main/src/rulesets/Base/array.jl#L15-L19

and the project to makes sure it is always NoTangent() for arrays of booleans, and it compiles away (at least the time is the same as with the dedicated rule)

@mzgubic mzgubic merged commit 595abfd into main Aug 22, 2022
@mzgubic mzgubic deleted the mz/ambiguities branch August 22, 2022 21:42
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.

repeat rrule ambiguity for Bool arrays
2 participants