Skip to content

support constructors with non_differentiable #243

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

Merged
merged 4 commits into from
Nov 20, 2020
Merged

Conversation

oxinabox
Copy link
Member

Closes #213

@oxinabox oxinabox added needs tests rule definition helper relating to helpers for declaring rules labels Oct 30, 2020
@oxinabox
Copy link
Member Author

JuliaDiff/ChainRules.jl#310 (comment) reminded me that i should finish this PR

@test pullback(1.2) == (NO_FIELDS, DoesNotExist())

# https://github.com/JuliaDiff/ChainRulesCore.jl/issues/213
# problem was that `@nondiff Foo(x)` was also defining rules for other types.
Copy link
Member

Choose a reason for hiding this comment

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

Wow, that's funky. I guess solves the issue in this comment?
JuliaDiff/ChainRules.jl#310 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep.
Its because typeof(Foo) == DataType and typeof(Bar) == DataType
but Core.Typeof(Foo) == Type{Foo} and Core.Typeof(Bar) == Type{Bar}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs tests rule definition helper relating to helpers for declaring rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support types in @non_differentiable
2 participants