mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
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
|
||
|---|---|---|
| .. | ||
| docstring_linter_testdata | ||
| heuristics | ||
| set_linter_testdata | ||
| gen_operators_yaml_test.py | ||
| gen_oplist_test.py | ||
| linter_test_case.py | ||
| test_cmake.py | ||
| test_codegen.py | ||
| test_codegen_model.py | ||
| test_create_alerts.py | ||
| test_docstring_linter.py | ||
| test_executorch_custom_ops.py | ||
| test_executorch_gen.py | ||
| test_executorch_signatures.py | ||
| test_executorch_types.py | ||
| test_executorch_unboxing.py | ||
| test_gen_backend_stubs.py | ||
| test_selective_build.py | ||
| test_set_linter.py | ||
| test_test_run.py | ||
| test_test_selections.py | ||
| test_upload_stats_lib.py | ||
| test_upload_test_stats.py | ||
| test_utils.py | ||
| test_vulkan_codegen.py | ||