-
Notifications
You must be signed in to change notification settings - Fork 25.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. 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
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
@pytorchbot label "suppress-bc-linter" |
Hi @janeyx99 Thank you for your hardwork! |
@sanjai-11 Go through the test that has failed and you'll know what to fix. |
@omkar-334 This is very useful, thanks |
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: 1 mandatory check(s) failed. The first few are: Dig deeper by viewing the failures on hud |
@sanjai-11 you haven't fixed all the things. You still have to remove Union and fix the line length. Lint errors are still occuring. |
@omkar-334 I tried my best to resolve the issues. I need to learn a lot. Thanks for your feedback. |
Your PR diff is showing too many changed files that have nothing to do with the intent of your PR. At some point during your development there was likely an incorrect merge or incorrect git pull rebase or similar. I suggest creating a new branch off of latest tip of upstream main, applying only the changes you intended, and then creating a new PR to replace this one. |
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
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 @H-Huang @awgu @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @jerryzh168 @gujinghui @PenghuiCheng @jianyuh @min-jean-cho @yanbing-j @Guobing-Chen @Xia-Weiwen @snadampal @mcarilli @ptrblck @leslie-fang-intel @voznesenskym @penguinwu @EikanWang @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @chenyang78 @kadeng @muchulee8 @amjames @chauhang @aakhundov @xmfan