pytorch/torchgen/executorch/api
Xuehai Pan 014726d9d3 [torchgen] Refactor torchgen.utils.FileManager to accept pathlib.Path (#150726)
This PR allows `FileManager` to accept `pathlib.Path` as arguments while keeping the original `str` path support.

This allows us to simplify the code such as:

1. `os.path.join(..., ...)` with `Path.__floordiv__(..., ...)`.

95a5958db4/torchgen/utils.py (L155)

95a5958db4/torchgen/utils.py (L176)

2. `os.path.basename(...)` with `Path(...).name`.
 95a5958db4/torchgen/utils.py (L161)

3. Manual file extension split with `Path(...).with_stem(new_stem)`

95a5958db4/torchgen/utils.py (L241-L256)

------

Pull Request resolved: https://github.com/pytorch/pytorch/pull/150726
Approved by: https://github.com/aorenste
2025-05-15 02:52:24 +00:00
..
types [TorchGen] Remove cpp_type_registration_declarations (#142452) 2024-12-11 19:01:36 +00:00
__init__.py [torchgen] Introduce Executorch types and signatures (#90781) 2022-12-14 20:13:04 +00:00
custom_ops.py [BE][CI] bump ruff to 0.9.2: multiline assert statements (#144546) 2025-02-27 20:46:16 +00:00
et_cpp.py [torchgen] Refactor torchgen.utils.FileManager to accept pathlib.Path (#150726) 2025-05-15 02:52:24 +00:00
unboxing.py [1/N] Apply py39 ruff fixes (#138578) 2024-12-02 21:46:18 +00:00