mapbox / mapbox/robosat

Pass device to torch.load instead of map_location function

Open
#14 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.1k
Forks
385
PR merge metrics
No merged PRs in 30d

Description

See for context: https://github.com/pytorch/pytorch/issues/7178. We currently are passing devices around except for `torch.load` where we have to pass a `map_location` function argument.

In https://github.com/pytorch/pytorch/pull/7339 this got changed and we can now pass the device to the `torch.load` function.

Note: 0.4.0 does not yet include these changes; we need to wait for another feature release.

Tasks:
- [ ] Pass device to load function
- [ ] Test and merge in sync with next PyTorch release

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the code path that calls torch.load and review how the device is currently passed through its map_location function. Wait for the PyTorch release containing the referenced change, then pass the device directly and test compatibility with that release. Done means the task checklist is satisfied and the change is tested and merged in sync with the release.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.