pytorch/.github
Xuehai Pan b6bdb67f82 [BE][Easy] use pathlib.Path instead of dirname / ".." / pardir (#129374)
Changes by apply order:

1. Replace all `".."` and `os.pardir` usage with `os.path.dirname(...)`.
2. Replace nested `os.path.dirname(os.path.dirname(...))` call with `str(Path(...).parent.parent)`.
3. Reorder `.absolute()` ~/ `.resolve()`~ and `.parent`: always resolve the path first.

    `.parent{...}.absolute()` -> `.absolute().parent{...}`

4. Replace chained `.parent x N` with `.parents[${N - 1}]`: the code is easier to read (see 5.)

    `.parent.parent.parent.parent` -> `.parents[3]`

5. ~Replace `.parents[${N - 1}]` with `.parents[${N} - 1]`: the code is easier to read and does not introduce any runtime overhead.~

    ~`.parents[3]` -> `.parents[4 - 1]`~

6. ~Replace `.parents[2 - 1]` with `.parent.parent`: because the code is shorter and easier to read.~

Pull Request resolved: https://github.com/pytorch/pytorch/pull/129374
Approved by: https://github.com/justinchuby, https://github.com/malfet
2024-12-29 17:23:13 +00:00
..
actions Remove builder repo from workflows and scripts (#143776) 2024-12-24 14:11:51 +00:00
ci_commit_pins [audio hash update] update the pinned audio hash (#143694) 2024-12-21 05:42:34 +00:00
ISSUE_TEMPLATE [ez] Make merge blocking sevs be based on label instead of string (#140636) 2024-11-14 19:02:27 +00:00
requirements Upgrade expecttest to 0.3.0 (#142869) 2024-12-11 19:04:16 +00:00
scripts [BE][Easy] use pathlib.Path instead of dirname / ".." / pardir (#129374) 2024-12-29 17:23:13 +00:00
templates Remove builder repo from workflows and scripts (#143776) 2024-12-24 14:11:51 +00:00
workflows Remove builder repo from workflows and scripts (#143776) 2024-12-24 14:11:51 +00:00
actionlint.yaml [ROCm] Use linux.rocm.gpu.2 for 2-GPU and linux.rocm.gpu.4 for 4-GPU runners (#143769) 2024-12-24 08:04:00 +00:00
auto_request_review.yml
label_to_label.yml autolabel aotinductor->export (#135040) 2024-09-03 20:17:51 +00:00
labeler.yml Add ciflow/inductor automatically in more cases (#140824) 2024-11-15 19:54:20 +00:00
merge_rules.yaml Add DCP doc to DCP merge-rules (#139938) 2024-11-07 02:19:49 +00:00
nitpicks.yml Add nitpicker, which allows adding comments to PRs when they match a file pattern (#133861) 2024-08-19 18:29:59 +00:00
PULL_REQUEST_TEMPLATE.md
pytorch-circleci-labels.yml
pytorch-probot.yml Update inductor jobs to use CUDA 12.4 (#142177) 2024-12-09 16:18:38 +00:00
regenerate.sh
requirements-gha-cache.txt [EZ] Update jinja2 to 3.1.5 (#143923) 2024-12-27 21:10:21 +00:00