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

Removing Device generic from Gradients & optimizers #402

Merged
merged 3 commits into from
Jan 26, 2023

Conversation

coreylowman
Copy link
Owner

This is a refactor of the Gradients object to remove the need for the existing generic argument on it. The presence of it meant that you had to specify the device on Optimizers, since they heavily use Gradients as a store of extra buffers.

Turns out, since gradients stores Box<Any>, it can just depend on getting the device from the type parameter passed into its methods, like it does with Shape & Dtype.

@coreylowman coreylowman merged commit 513470e into main Jan 26, 2023
@coreylowman coreylowman deleted the remove-device-from-optims branch January 26, 2023 15:46
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.

1 participant