27 Commits

Author SHA1 Message Date
0b5a99be88 remove duplicate import for defaultdict (#160519)
Fixes #160518

This PR aims to remove the duplicate import of defaultdict in the following file:

ecde76c764/functorch/op_analysis/gen_data.py (L36)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/160519
Approved by: https://github.com/malfet
2025-09-20 04:06:39 +00:00
26f4f10ac8 [5/N][Easy] fix typo for usort config in pyproject.toml (kown -> known): sort torch (#127126)
The `usort` config in `pyproject.toml` has no effect due to a typo. Fixing the typo make `usort` do more and generate the changes in the PR. Except `pyproject.toml`, all changes are generated by `lintrunner -a --take UFMT --all-files`.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/127126
Approved by: https://github.com/kit1980
2024-05-27 14:49:57 +00:00
55c0ab2887 Revert "[5/N][Easy] fix typo for usort config in pyproject.toml (kown -> known): sort torch (#127126)"
This reverts commit 7763c83af67eebfdd5185dbe6ce15ece2b992a0f.

Reverted https://github.com/pytorch/pytorch/pull/127126 on behalf of https://github.com/XuehaiPan due to Broken CI ([comment](https://github.com/pytorch/pytorch/pull/127126#issuecomment-2133044286))
2024-05-27 09:22:08 +00:00
7763c83af6 [5/N][Easy] fix typo for usort config in pyproject.toml (kown -> known): sort torch (#127126)
The `usort` config in `pyproject.toml` has no effect due to a typo. Fixing the typo make `usort` do more and generate the changes in the PR. Except `pyproject.toml`, all changes are generated by `lintrunner -a --take UFMT --all-files`.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/127126
Approved by: https://github.com/kit1980
ghstack dependencies: #127122, #127123, #127124, #127125
2024-05-27 04:22:18 +00:00
f9200c8608 [BE][Ez]: FURB129: remove unneeded readlines() (#119796)
Applies a refurb rule to remove any readlines() in a for loop iteration as it just creates a temporary list in memory.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/119796
Approved by: https://github.com/ezyang
2024-02-13 21:21:22 +00:00
e6ec0efaf8 Apply UFMT to all non test/torch files (#106205)
Signed-off-by: Edward Z. Yang <ezyang@meta.com>

Pull Request resolved: https://github.com/pytorch/pytorch/pull/106205
Approved by: https://github.com/albanD
2023-07-29 02:56:24 +00:00
8a688277a2 [BE] Enable ruff's UP rules and autoformat dynamo / functorch and refs (#105432)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/105432
Approved by: https://github.com/ezyang
2023-07-19 13:48:44 +00:00
79c9e82e27 Fix flake8 lint errors reported by ruff - take 2 (#99798)
Replaces #99784. This PR is pure autofix.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/99798
Approved by: https://github.com/Skylion007, https://github.com/kit1980
2023-04-23 23:09:51 +00:00
5471621497 [BE] Remove unnecessary dict comprehensions (#97116)
Removes unnecessary dict comprehensions that optimize creation of dicts from iterables

Pull Request resolved: https://github.com/pytorch/pytorch/pull/97116
Approved by: https://github.com/kit1980
2023-03-20 00:56:57 +00:00
663967777b Handle redispatch correctly with tensor subclasses in ProxyTensor mode (#83122)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83122
Approved by: https://github.com/ezyang
2022-08-11 01:31:16 +00:00
f59a85de7f [functorch] updated op analysis script 2022-07-21 13:41:35 -07:00
99abac4b25 [functorch] fix flake 2022-07-21 13:41:32 -07:00
855f939ce3 [functorch] fixed complex number decompositions and added isnan 2022-07-21 13:41:32 -07:00
9eb10d033c [functorch] updated some decompositions and cleaned some stuff 2022-07-21 13:41:31 -07:00
eeb3f14d0b [functorch] Added rrelu_with_noise_backward decomposition 2022-07-21 13:41:22 -07:00
5bbb1b039d [functorch] Added softshrink_backward, prelu_backward, and col2im_backward decompositions 2022-07-21 13:41:22 -07:00
c94446a04d [functorch] Fixed python code formatting and added flake8 setup (pytorch/functorch#346)
* Fixed python code formatting and added flake8 setup

* Fixes config.yaml

* Added missing setup.cfg

* Removed flake8 job from circle ci and setup GHA

* More flake8 fixes

* Fixed test_conv2d

* Fixed failing flake8
2022-07-21 13:41:17 -07:00
85576dbb2d [functorch] update op analysis script 2022-07-21 13:41:14 -07:00
ab64065e5e [functorch] updated with some more decompositions 2022-07-21 13:41:13 -07:00
fe9aac72d1 [functorch] Added decomposition testing + display infra (pytorch/functorch#281)
* Added decomposition testing + display infra

* add a couple more decompositions

* changed some stuff

* made some changes

* Added decomposition testing + display infra

* add a couple more decompositions

* fix some decompositions

* changed some stuff

* updated generation

* fix test failures

* removed extraneous files

* fixed test failures

* fixed tests

* updated

* fixed tests again
2022-07-21 13:41:12 -07:00
bfb19e7921 [functorch] updated gen_data script 2022-07-21 13:41:09 -07:00
d9de3842d6 [functorch] renamed some variables in gen_data 2022-07-21 13:41:05 -07:00
9e0005fca3 [functorch] updated gen_data.py 2022-07-21 13:41:05 -07:00
486679ba23 [functorch] Updated gen_data script to use new APIs 2022-07-21 13:41:02 -07:00
b04e50d421 [functorch] Finished rest of easy pointwise operators (16 of them)- bitwise_and, heaviside, hypot, gcd, igamma, igammac, lcm, nextafter, polar, rrelu_with_noise, bitwise_not, glu, logit, mish, threshold, copysign (kinda) 2022-07-21 13:41:01 -07:00
6136d66b58 [functorch] updated the op DB 2022-07-21 13:41:01 -07:00
eae7765bb7 [functorch] Added operator analysis generator 2022-07-21 13:41:01 -07:00