-
Notifications
You must be signed in to change notification settings - Fork 24.1k
Remove redundant type aliases of _device_t for torch.Device (#152952) #153007
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
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/153007
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Unrelated FailureAs of commit 2173423 with merge base 5fa5017 ( NEW FAILURE - The following job has failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@pytorchbot label "topic: not user facing" |
@@ -23,7 +23,7 @@ def empty_cache() -> None: | |||
torch._C._xpu_emptyCache() | |||
|
|||
|
|||
def reset_peak_memory_stats(device: _device_t = None) -> None: | |||
def reset_peak_memory_stats(device: torch.types.Device = None) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe line 10 is no longer needed.
Line 10 in dfcfad2
_device_t = Union[Device, str, int, None] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the review. Will change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
Fixes #152952
This PR removes redundant type aliases for
_device_t
and replaces them withtorch.types.Device
where applicable, to make the typing system more consistent across PyTorch.cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @jerryzh168