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

What if lifted_getfield on a tangent just called getproperty #39

Merged
merged 1 commit into from
Sep 24, 2021

Conversation

oxinabox
Copy link
Member

Semantically these are the same.
but lets see if this works out right

@simeonschaub
Copy link
Member

@Keno Any objections? This should be fine, right?

@Keno
Copy link
Collaborator

Keno commented Sep 8, 2021

If it works, ok by me.

@simeonschaub
Copy link
Member

I plan to set up some CI as soon as I figure out the problem on latest Julia nightly. Since this doesn't seem urgent, I'll probably hold off on this until then, so we can merge with some confidence.

@simeonschaub simeonschaub changed the title What if lifted_getfeild on a tangent just called getproperty What if lifted_getfield on a tangent just called getproperty Sep 10, 2021
@simeonschaub
Copy link
Member

Ah, this breaks down for getfield(::NamedTuple, ::Int). Good that we have CI now.

@oxinabox
Copy link
Member Author

We should consider adding that overload in CRC so this works.
It would be useful in other places.
(I wanted it in a Zygote PR where for NT I couldn't tell if I was going to get a symbol or a int)

simeonschaub added a commit to JuliaDiff/ChainRulesCore.jl that referenced this pull request Sep 20, 2021
also fixes some issues with `getindex`, mainly that it didn't
canonicalize tangents with NamedTuple backing, which I'd argue is a bug.
It's also more consistent with `getproperty` now, so `tangent[:a]`
returns `ZeroTangent()` instead of erroring if `tangent`'s backing
doesn't have a field `a`.

ref JuliaDiff/Diffractor.jl#39
@simeonschaub simeonschaub reopened this Sep 20, 2021
simeonschaub added a commit to JuliaDiff/ChainRulesCore.jl that referenced this pull request Sep 21, 2021
also fixes some issues with `getindex`, mainly that it didn't
canonicalize tangents with NamedTuple backing, which I'd argue is a bug.
It's also more consistent with `getproperty` now, so `tangent[:a]`
returns `ZeroTangent()` instead of erroring if `tangent`'s backing
doesn't have a field `a`.

ref JuliaDiff/Diffractor.jl#39
@simeonschaub
Copy link
Member

simeonschaub commented Sep 21, 2021

@Keno Any ideas about the hang on Windows? Is that worth investigating? (Failing job is https://github.com/JuliaDiff/Diffractor.jl/runs/3658202821?check_suite_focus=true for reference.)

@Keno
Copy link
Collaborator

Keno commented Sep 22, 2021

No idea. I've never tried it on windows. I'd say just disable the CI job for now.

@simeonschaub simeonschaub merged commit be4eeb5 into main Sep 24, 2021
@simeonschaub simeonschaub deleted the ox/lessweird_lft branch September 24, 2021 18:43
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