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

Allow more object types for model input and labels #29

Merged
merged 2 commits into from Apr 18, 2020
Merged

Allow more object types for model input and labels #29

merged 2 commits into from Apr 18, 2020

Conversation

scottclowe
Copy link
Contributor

Instead of checking whether the object is a tensor, and if it is using .to() to move it to the right device, we use duck-typing and utilise the .to() method of any object which has one. This means we support higher level torch objects which contain tensors and possess a .to() method to move the entire object to a new device.

We also add support for dictionaries, in the same manner as tuples and lists are currently supported (making a new dict containing moved versions of the original contents).

@davidtvs davidtvs merged commit a81766f into davidtvs:master Apr 18, 2020
@davidtvs
Copy link
Owner

LGTM. Thanks for the PR

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.

None yet

2 participants