Justin Chu
4cc1745b13
[BE] f-stringify torch/ and scripts ( #105538 )
...
This PR is a follow up on the pyupgrade series to convert more strings to use f-strings using `flynt`.
- https://docs.python.org/3/reference/lexical_analysis.html#f-strings
- https://pypi.org/project/flynt/
Command used:
```
flynt torch/ -ll 120
flynt scripts/ -ll 120
flynt tools/ -ll 120
```
and excluded `collect_env.py`
Pull Request resolved: https://github.com/pytorch/pytorch/pull/105538
Approved by: https://github.com/ezyang , https://github.com/malfet
2023-07-21 19:35:24 +00:00
Peter Bell
454361435c
Implement correction argument in torch.masked.{std,var} ( #87118 )
...
This makes the signature of `torch.masked.std` and `var` more consistent with the global namespace variant and also updates the sample inputs to repurpose the existing `sample_inputs_std_var` inputs which fully exercise the `correction` argument.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/87118
Approved by: https://github.com/cpuhrsch
2022-12-08 15:59:09 +00:00
mantaionut
7c0bb61291
Force numpy prod to use 64 bit integers on Windows in some tests ( #88089 )
...
This fixes some prod and masked.prod tests on Windows.
np.prod uses int32 on Windows so it overflows.
On Linux it uses by default int64.
Fixes #77305
Fixes #77320
Fixes #77334
Fixes #77335
Fixes #77336
Fixes #77337
Pull Request resolved: https://github.com/pytorch/pytorch/pull/88089
Approved by: https://github.com/mruberry
2022-11-22 18:37:14 +00:00
Peter Bell
91eb1b9bb9
Move _masked opinfos to opinfo/definitions/_masked.py ( #83763 )
...
Ref #82518
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83763
Approved by: https://github.com/albanD
2022-08-22 19:08:41 +00:00
Peter Bell
7656ef73f1
Move torch.special OpInfos into opinfo/definitions/special.py ( #83762 )
...
Ref #82518
As with `linalg` this doesn't include ops with an alias in special,
only the ones where `special.foo` is the actual name of the opinfo.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83762
Approved by: https://github.com/albanD
2022-08-22 19:08:41 +00:00
Peter Bell
ae68e455be
Enable formatting in all of testing/_internal/opinfo ( #83559 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83559
Approved by: https://github.com/albanD
2022-08-19 12:25:57 +00:00
PyTorch MergeBot
61b2cde527
Revert "Enable formatting in all of testing/_internal/opinfo ( #83559 )"
...
This reverts commit a7e6196909 .
Reverted https://github.com/pytorch/pytorch/pull/83559 on behalf of https://github.com/peterbell10 due to Stack broke lint
2022-08-19 02:27:03 +00:00
Peter Bell
a7e6196909
Enable formatting in all of testing/_internal/opinfo ( #83559 )
...
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83559
Approved by: https://github.com/albanD
2022-08-19 01:49:45 +00:00
Peter Bell
4d405517e4
Move OpInfo class into new opinfo folder ( #82540 )
...
Ref #82518
Starting small to minimize merge conflicts, this moves the top-level
class definitions and some helper functions into the `opinfos` folder.
It also brings `common_methods_invocations.py` to just below 1MB.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82540
Approved by: https://github.com/albanD
2022-08-05 15:10:17 +00:00