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

Removes rules depending on casted #120

Merged
merged 3 commits into from
Oct 17, 2019
Merged

Removes rules depending on casted #120

merged 3 commits into from
Oct 17, 2019

Conversation

oxinabox
Copy link
Member

Matches to JuliaDiff/ChainRulesCore.jl#55

There is also a surprisingly large change to hypot's tests
as they were AFAWCT nonsense.

Copy link
Contributor

@nickrobinson251 nickrobinson251 left a comment

Choose a reason for hiding this comment

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

Couple questions, but the changes LGTM as is

@@ -59,7 +59,7 @@ end

function rrule(::typeof(sum), x)
function sum_pullback(ȳ)
return (NO_FIELDS, cast(ȳ))
return (NO_FIELDS, @thunk(fill(ȳ, size(x))))
Copy link
Contributor

Choose a reason for hiding this comment

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

should we consider using Fill from FillArrays instead of fill?

Copy link
Member

Choose a reason for hiding this comment

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

That's definitely a thing we're going to do, but at a later date, just to avoid the added complexity for now (we don't want to have to deal with any FillArray-specific issues that aren't really ChainRules things for the time being)

Δz = randn(rng)

frule_test(hypot, (x, Δx), (y, Δy))
rrule_test(hypot, Δz, (x, x̄), (y, ȳ))
Copy link
Contributor

Choose a reason for hiding this comment

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

if there a reason these use frule_test but the tests for e.g. atan2 call frule then test the output.

Is it because the atan2 tests pre-date frule_test?

Copy link
Member

Choose a reason for hiding this comment

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

Is it because the atan2 tests pre-date frule_test?

I suspect that this is the case. Will open an issue and resolve at a later date.

Project.toml Outdated Show resolved Hide resolved
@willtebbutt willtebbutt merged commit 9e4cb76 into master Oct 17, 2019
@oxinabox oxinabox deleted the ox/nocast2 branch August 17, 2020 07:48
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