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
d8c8ba2440
Fix unused Python variables in test/[e-z]* ( #136964 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/136964
Approved by: https://github.com/justinchuby , https://github.com/albanD
2024-12-18 23:02:30 +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
d82c2b14c7
jit trace will fail for parameter check if it contains param whose ki… ( #94032 )
...
…nd is _ParameterKind.VAR_KEYWORD
Pull Request resolved: https://github.com/pytorch/pytorch/pull/94032
Approved by: https://github.com/qihqi , https://github.com/davidberard98
2023-02-13 20:33:30 +00:00
5976f0bdfe
Set min supported Python version to 3.8 ( #93155 )
...
Also, grep for `if sys.version_info .cond. (3, 8)` and replaces them with appropriate action.
This is a last in a series of PRs that moved CI/CD away from testing PyTorch behavior against Python-3.7.
Fixes https://github.com/pytorch/pytorch/issues/80513
Pull Request resolved: https://github.com/pytorch/pytorch/pull/93155
Approved by: https://github.com/huydhn
2023-01-29 18:28:46 +00:00
eb49dde9cf
Disable TracerWarnings on NNC opinfo tests
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78756
Approved by: https://github.com/davidberard98
2022-06-03 18:11:12 +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
c5cc185b6d
Allow uncompiled strings as input to checkScriptRaisesRegex ( #63901 )
...
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63901
cc gmagogsfm
Test Plan: Imported from OSS
Reviewed By: gmagogsfm
Differential Revision: D30579472
Pulled By: ansley
fbshipit-source-id: 59ee09c1f25278d4f6e51f626588251bd095c6ea
2021-08-26 12:17:07 -07:00
705fa7e964
[Usability] Capture argument names for traced functions and modules ( #51775 )
...
Summary:
Previously `torch.jit.trace` relies on AutoGrad hooks to infer name of tensors in computation, including those of function/method arguments. This often doesn't work out because:
- These names often do not exist
- Tracer uses argument name of first tensor operation on each tensor as inferred argument names. These tensor operations have programmatically-generated names like `argument_1`
This PR extracts argument names directly from Python functions and pass them down to tracer, which then assigns them to correct graph inputs. This way, we always have the correct argument names captured in IR.
This is useful for both debugging and supporting using `InterfaceType` to represent traced modules.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/51775
Reviewed By: izdeby
Differential Revision: D26273105
Pulled By: gmagogsfm
fbshipit-source-id: 934a385041137dc3731bb6fa8657b11532fed9e5
2021-02-10 18:28:08 -08:00