bf7e290854
Add __main__ guards to jit tests ( #154725 )
...
This PR is part of a series attempting to re-submit https://github.com/pytorch/pytorch/pull/134592 as smaller PRs.
In jit tests:
- Add and use a common raise_on_run_directly method for when a user runs a test file directly which should not be run this way. Print the file which the user should have run.
- Raise a RuntimeError on tests which have been disabled (not run)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/154725
Approved by: https://github.com/clee2000
2025-06-16 10:28:45 +00:00
20912673a6
Revert "Add __main__ guards to jit tests ( #154725 )"
...
This reverts commit 1a55fb0ee87eaa8b376aaa82d95d213fe0fbe64b.
Reverted https://github.com/pytorch/pytorch/pull/154725 on behalf of https://github.com/malfet due to This added 2nd copy of raise_on_run to common_utils.py which caused lint failures, see https://github.com/pytorch/pytorch/actions/runs/15445374980/job/43473457466 ([comment](https://github.com/pytorch/pytorch/pull/154725#issuecomment-2940503905 ))
2025-06-04 15:42:52 +00:00
1a55fb0ee8
Add __main__ guards to jit tests ( #154725 )
...
This PR is part of a series attempting to re-submit https://github.com/pytorch/pytorch/pull/134592 as smaller PRs.
In jit tests:
- Add and use a common raise_on_run_directly method for when a user runs a test file directly which should not be run this way. Print the file which the user should have run.
- Raise a RuntimeError on tests which have been disabled (not run)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/154725
Approved by: https://github.com/Skylion007
2025-06-04 14:44:08 +00:00
6ff1e43a41
[BE][Easy][13/19] enforce style for empty lines in import segments in test/j*/
( #129764 )
...
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/129764
Approved by: https://github.com/ezyang
2024-08-01 12:13:42 +00:00
604c9c5601
Enable UFMT on all of test/jit
( #123623 )
...
Partially addresses #123062
Ran lintrunner on:
- `test/jit`
with command:
```bash
lintrunner -a --take UFMT --all-files
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/123623
Approved by: https://github.com/ezyang
2024-04-11 23:45:05 +00:00
088f2fa567
Fix typos in messages under test ( #89121 )
...
This PR fixes typos of messages in `.cpp` and `.py` files under test directory.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/89121
Approved by: https://github.com/mruberry , https://github.com/kit1980
2022-11-17 01:55:03 +00:00
09c7771e9c
Set test owners for jit tests ( #66808 )
...
Summary:
Action following https://github.com/pytorch/pytorch/issues/66232
Pull Request resolved: https://github.com/pytorch/pytorch/pull/66808
Reviewed By: mrshenli
Differential Revision: D31761414
Pulled By: janeyx99
fbshipit-source-id: baf8c49ff9c4bcda7b0ea0f6aafd26380586e72d
2021-10-25 07:51:10 -07:00
79a258f448
s/foward/forward/g ( #58497 )
...
Summary:
Annoying typo.
Prompted by these profiling results: https://github.com/pytorch/pytorch/issues/56419#issuecomment-825787828
Pull Request resolved: https://github.com/pytorch/pytorch/pull/58497
Reviewed By: malfet
Differential Revision: D28521081
Pulled By: Chillee
fbshipit-source-id: ab91a2e167dd7d3387fd56106a6cff81f7a32f10
2021-05-19 11:42:42 -07:00
4753100a3b
Un-ignore F403 in .flake8 ( #55838 )
...
Summary:
Generally wildcard imports are bad for the reasons described here: https://www.flake8rules.com/rules/F403.html
This PR replaces wildcard imports with an explicit list of imported items where possible, and adds a `# noqa: F403` comment in the other cases (mostly re-exports in `__init__.py` files).
This is a prerequisite for https://github.com/pytorch/pytorch/issues/55816 , because currently [`tools/codegen/dest/register_dispatch_key.py` simply fails if you sort its imports](https://github.com/pytorch/pytorch/actions/runs/742505908 ).
Pull Request resolved: https://github.com/pytorch/pytorch/pull/55838
Test Plan: CI. You can also run `flake8` locally.
Reviewed By: jbschlosser
Differential Revision: D27724232
Pulled By: samestep
fbshipit-source-id: 269fb09cb4168f8a51fd65bfaacc6cda7fb87c34
2021-04-13 09:24:07 -07:00
68e0796466
[JIT][write path] Make NoneType annotation_str emit NoneType
instead of None
( #54746 )
...
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/54746
Test Plan: Imported from OSS
Reviewed By: SplitInfinity
Differential Revision: D27350331
Pulled By: jamesr66a
fbshipit-source-id: 3f44d6589c29f39378432d0b6b281d96bb4829e7
2021-04-12 17:36:45 -07:00
ec3aae8cdb
[JIT] Enable saving modules with hooks in FBCODE ( #51241 )
...
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/51241
Test Plan: Imported from OSS
Reviewed By: SplitInfinity
Differential Revision: D26111488
Pulled By: Lilyjjo
fbshipit-source-id: 3315068ac9adef8aa23670a4a5f86c5a54fdd1f7
2021-02-01 17:01:44 -08:00
3b88e1b0e7
[WIP] JIT Static Hooks: python tests ( #49546 )
...
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/49546
Test Plan: Imported from OSS
Reviewed By: heitorschueroff
Differential Revision: D25771119
Pulled By: Lilyjjo
fbshipit-source-id: bf8a8e20f790691d3ff58fa9c8d0d9ab3e8322c4
2021-01-20 09:12:53 -08:00