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

Minimal fix of #1556, remove eltype checks #1558

Merged
merged 2 commits into from
Mar 31, 2021

Conversation

mcabbott
Copy link
Member

@mcabbott mcabbott commented Mar 31, 2021

Fix #1556, closes #1557.

Tests of this conversion behaviour are left skipped for now, that seems the minimal step. Perhaps friendly warnings if you're about to accidentally promote to Float64 can be combined with not rejecting tracking types. But that need not be designed in a rush.

The complete solution of #1556 should include tests of gradients through the re of destructure. At the moment it is (I think) only tested alongside loadparams! as an "offline" utility, but clearly it's also useful to map a vector of parameters to a model inside a solver, etc. Perhaps it can be made faster, too.

@mcabbott mcabbott requested a review from darsnack March 31, 2021 19:06
@darsnack
Copy link
Member

Okay well both this PR and #1557 are "approved" by me, but we can only merge one. Personally, there are aspects of both PRs that I would mix and match. #1557 removes the inner constructor for Dense and widens the weight type, which I think is right. But this PR doesn't make changes to the the main user-facing constructor for Dense while #1557 does (and I think those changes increase the surface area for errors). Other than that, both PRs fix #1556.

@DhairyaLGandhi
Copy link
Member

DhairyaLGandhi commented Mar 31, 2021

Thanks for the PR! Appreciate the quick response, and agree that we don't want to rush.

This solves the particular MWE of #1556, on balance, we also add some other cleanups in the other PR, ie loosening the type restriction and removing the inner constructor which we want. These are connected issues and both good changes. What I am inclined to do is merge both PRs, since #1557 is effectively a superset.

bors r+

@DhairyaLGandhi
Copy link
Member

bors ping

@bors
Copy link
Contributor

bors bot commented Mar 31, 2021

pong

@DhairyaLGandhi DhairyaLGandhi merged commit 28f34d1 into FluxML:master Mar 31, 2021
@darsnack
Copy link
Member

Probably the test @mcabbott mentioned can be added to the "downstream CI" @DhairyaLGandhi is adding in #1555. We should also add some tests for "non-conventional" parameter array types.

@mcabbott
Copy link
Member Author

mcabbott commented Mar 31, 2021

and agree that we don't want to rush.

Then why did you?

Arguments for changes other than fixing #1556 really need to stand on their own merits. They were extensively discussed at the time. I think you should revert #1557, and (if you want to discuss other changes) open a normal discussion.

@mcabbott mcabbott deleted the issue1556 branch March 31, 2021 21:47
@DhairyaLGandhi DhairyaLGandhi mentioned this pull request Apr 1, 2021
@darsnack
Copy link
Member

darsnack commented Apr 1, 2021

Never mind, I misunderstood the downstream CI. We should add the tests mentioned here directly to Flux.

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.

Restructure on Dense no longer plays nicely with alternative types
3 participants