mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
remove unused all_generator_source from generate_code (#75868)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/75868 This is unused in OSS and internally. ghstack-source-id: 154696014 Test Plan: I manually verified it is unused and am relying on CI to confirm. Reviewed By: dreiss Differential Revision: D35674693 fbshipit-source-id: 945ec0590e9d939eab8944ae48bae72cb61e6261 (cherry picked from commit 01a29161b0a3b386078df3cd081358786a6d8f53)
This commit is contained in:
committed by
PyTorch MergeBot
parent
8b1cf8ed6b
commit
f010b15db9
@ -3,7 +3,7 @@ import os
|
|||||||
import pathlib
|
import pathlib
|
||||||
import sys
|
import sys
|
||||||
import yaml
|
import yaml
|
||||||
from typing import Any, List, Optional, cast
|
from typing import Any, Optional, cast
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# use faster C loader if available
|
# use faster C loader if available
|
||||||
@ -11,22 +11,8 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
from yaml import SafeLoader as YamlLoader # type: ignore[misc]
|
from yaml import SafeLoader as YamlLoader # type: ignore[misc]
|
||||||
|
|
||||||
source_files = {".py", ".cpp", ".h"}
|
|
||||||
|
|
||||||
NATIVE_FUNCTIONS_PATH = "aten/src/ATen/native/native_functions.yaml"
|
NATIVE_FUNCTIONS_PATH = "aten/src/ATen/native/native_functions.yaml"
|
||||||
|
|
||||||
# TODO: This is a little inaccurate, because it will also pick
|
|
||||||
# up setup_helper scripts which don't affect code generation
|
|
||||||
def all_generator_source() -> List[str]:
|
|
||||||
r = []
|
|
||||||
for directory, _, filenames in os.walk("tools"):
|
|
||||||
for f in filenames:
|
|
||||||
if os.path.splitext(f)[1] in source_files:
|
|
||||||
full = os.path.join(directory, f)
|
|
||||||
r.append(full)
|
|
||||||
return sorted(r)
|
|
||||||
|
|
||||||
|
|
||||||
def generate_code(
|
def generate_code(
|
||||||
ninja_global: Optional[str] = None,
|
ninja_global: Optional[str] = None,
|
||||||
native_functions_path: Optional[str] = None,
|
native_functions_path: Optional[str] = None,
|
||||||
|
Reference in New Issue
Block a user