Revert "[BE][Easy] replace import pathlib with from pathlib import Path (#129426)"

This reverts commit 6d75604ef135925e8c85363c2f4a5e0b6f7fef28.

Reverted https://github.com/pytorch/pytorch/pull/129426 on behalf of https://github.com/XuehaiPan due to recognize `Path` as new exported API ([comment](https://github.com/pytorch/pytorch/pull/129426#issuecomment-2198371625))
This commit is contained in:
PyTorch MergeBot
2024-06-29 23:24:06 +00:00
parent 67c9ec2b6d
commit 2effbcfcd8
33 changed files with 140 additions and 159 deletions

View File

@ -2,8 +2,8 @@ from __future__ import annotations
import argparse
import os
import pathlib
from collections import namedtuple
from pathlib import Path
from typing import Any, Callable, Iterable, Iterator, Sequence
import yaml
@ -252,7 +252,7 @@ def main() -> None:
options = parser.parse_args()
# Assumes that this file lives at PYTORCH_ROOT/torchgen/gen_backend_stubs.py
torch_root = Path(__file__).parent.parent.parent.absolute()
torch_root = pathlib.Path(__file__).parent.parent.parent.absolute()
aten_path = str(torch_root / "aten" / "src" / "ATen")
lazy_ir_generator: type[GenLazyIR] = default_args.lazy_ir_generator
if options.gen_ts_lowerings: