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

send self.loss_func to device if it is an insatnce on nn.Module #3395

Merged
merged 3 commits into from Jun 15, 2021
Merged

send self.loss_func to device if it is an insatnce on nn.Module #3395

merged 3 commits into from Jun 15, 2021

Conversation

arampacha
Copy link
Contributor

If loss_func has assoicated parameters or buffers on other device it triggers error. This PR adds a line to send loss_func to device in TrainEvalCallback is it's an instance of nn.Module.
Minimal example gist: https://gist.github.com/arampacha/ae6299a7b577da3d2d18e88bec2e39e2

If this makes sense it's possible to add BaseLoss.to method and have similar behavior for it

@arampacha arampacha requested a review from jph00 as a code owner June 2, 2021 13:10
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@jph00 jph00 merged commit 8e478b6 into fastai:master Jun 15, 2021
@arampacha arampacha deleted the loss_func-device branch May 14, 2022 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants