-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure safe_to_tensor moves tensors to the specified device. (#831)
This PR fixes a bug in the `safe_to_tensor` utility: previously it did not move tensors to a new device according to the `device` kwarg which caused issues when there is more than one device available. The bug went unnoticed for a long while since our circleCI runners do not have GPUs enabled.
- Loading branch information
Showing
10 changed files
with
32 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,7 +90,7 @@ commands: | |
steps: | ||
- run: | ||
name: install macOS packages | ||
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install coreutils parallel gnu-getopt | ||
command: HOMEBREW_NO_AUTO_UPDATE=1 brew install coreutils gnu-getopt parallel [email protected] virtualenv | ||
|
||
- checkout | ||
|
||
|
@@ -138,11 +138,13 @@ commands: | |
# Download and cache dependencies | ||
- restore_cache: | ||
keys: | ||
- v11win-dependencies-{{ checksum "setup.py" }}-{{ checksum "ci/build_and_activate_venv.ps1" }} | ||
- v13win-dependencies-{{ checksum "setup.py" }}-{{ checksum "ci/build_and_activate_venv.ps1" }} | ||
|
||
- run: | ||
name: install python | ||
command: choco install --allow-downgrade -y python --version=3.8.10 | ||
# Use python3.9 in Windows instead of python3.8 because otherwise | ||
# pytest-notebook's indirect dependency pywinpty will fail to build. | ||
command: choco install --allow-downgrade -y python --version=3.9.13 | ||
shell: powershell.exe | ||
|
||
- run: | ||
|
@@ -163,14 +165,20 @@ commands: | |
|
||
- run: | ||
name: install dependencies | ||
# Only create venv if it's not been restored from cache | ||
command: if (-not (Test-Path venv)) { .\ci\build_and_activate_venv.ps1 -venv venv } | ||
# Only create venv if it's not been restored from cache. | ||
# Need to throw error explicitly on error or else {} will get rid of | ||
# the exit code. | ||
command: | | ||
if (-not (Test-Path venv)) { | ||
.\ci\build_and_activate_venv.ps1 -venv venv | ||
if ($LASTEXITCODE -ne 0) { throw "Failed to create venv" } | ||
} | ||
shell: powershell.exe | ||
|
||
- save_cache: | ||
paths: | ||
- .\venv | ||
key: v11win-dependencies-{{ checksum "setup.py" }}-{{ checksum "ci/build_and_activate_venv.ps1" }} | ||
key: v13win-dependencies-{{ checksum "setup.py" }}-{{ checksum "ci/build_and_activate_venv.ps1" }} | ||
|
||
- run: | ||
name: install imitation | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
[mypy] | ||
ignore_missing_imports = true | ||
exclude = output | ||
|
||
# torch had some type errors, we ignore them because they're not our fault | ||
[mypy-torch._dynamo.*] | ||
follow_imports = skip | ||
follow_imports_for_stubs = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters