Yuanyuan Chen
3cda34ebde
[2/N] Apply ruff UP035 check in torch files ( #164054 )
...
This is the result of applying the ruff `UP035` check.
`Callable` is imported from `collections.abc` instead of `typing`.
`TypeAlias` is also imported from `typing`.
This PR is the follow-up of #163947 .
Pull Request resolved: https://github.com/pytorch/pytorch/pull/164054
Approved by: https://github.com/ezyang , https://github.com/Skylion007
2025-09-29 03:35:32 +00:00
Aaron Orenstein
0afd335174
PEP585 update - torch/nn torch/optim torch/package torch/profiler torch/serialization torch/sparse torch/xpu ( #145175 )
...
See #145101 for details.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/145175
Approved by: https://github.com/bobrenjc93
2025-01-21 16:57:27 +00:00
PyTorch MergeBot
5fd881a5b6
Revert "PEP585 update - torch/nn torch/optim torch/package torch/profiler torch/serialization torch/sparse torch/xpu ( #145175 )"
...
This reverts commit 54a00af2c6 .
Reverted https://github.com/pytorch/pytorch/pull/145175 on behalf of https://github.com/huydhn due to Sorry for reverting your change but it seems to break some trunk tests ([comment](https://github.com/pytorch/pytorch/pull/145175#issuecomment-2603418267 ))
2025-01-21 00:49:55 +00:00
Aaron Orenstein
54a00af2c6
PEP585 update - torch/nn torch/optim torch/package torch/profiler torch/serialization torch/sparse torch/xpu ( #145175 )
...
See #145101 for details.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/145175
Approved by: https://github.com/bobrenjc93
2025-01-20 22:32:59 +00:00
Xuehai Pan
30293319a8
[BE][Easy][19/19] enforce style for empty lines in import segments in torch/[o-z]*/ ( #129771 )
...
See https://github.com/pytorch/pytorch/pull/129751#issue-2380881501 . Most changes are auto-generated by linter.
You can review these PRs via:
```bash
git diff --ignore-all-space --ignore-blank-lines HEAD~1
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/129771
Approved by: https://github.com/justinchuby , https://github.com/janeyx99
2024-08-01 17:07:14 +00:00
Aaron Orenstein
8db9dfa2d7
Flip default value for mypy disallow_untyped_defs [9/11] ( #127846 )
...
See #127836 for details.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/127846
Approved by: https://github.com/ezyang
ghstack dependencies: #127842 , #127843 , #127844 , #127845
2024-06-08 18:50:06 +00:00
anjali411
3bcc19b29a
Add __all__ to various submodules in torch.fx, distributions, distributed, package ( #80367 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80367
Approved by: https://github.com/albanD
2022-06-27 21:27:30 +00:00
Michael Suo
ed4cda0183
[pkg] opt into autoformat
...
Summary: woooo
Test Plan: arc lint --apply-patches --take BLACK --paths-cmd 'hg files -I "caffe2/**/*.py"'
Reviewed By: SplitInfinity
Differential Revision: D28608934
fbshipit-source-id: 7768fed50a87883a95319376c0a6d73a9492bdcc
2021-05-21 15:03:52 -07:00
Meghan Lele
7985753421
[package] Add dependency tracing function ( #55167 )
...
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/55167
**Summary**
This commit adds a function that uses `sys.setprofile` to trace the
execution of a callable in order to determine which modules it really
uses. The result of this trace can inform packaging decisions.
**Test Plan**
This commit adds a unit test to `test_analyze.py` that tests this
feature.
Test Plan: Imported from OSS
Reviewed By: jbschlosser
Differential Revision: D27730805
Pulled By: SplitInfinity
fbshipit-source-id: 11802625564513da9a0144904be0d34dbae0f601
2021-04-14 00:06:40 -07:00