Use yaml.SafeLoader instead of legacy yaml.Loader (#100443)

See 957ae4d495/lib/yaml/loader.py (L51)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/100443
Approved by: https://github.com/Skylion007
This commit is contained in:
Sergii Dymchenko 2023-05-02 18:32:31 +00:00 committed by PyTorch MergeBot
parent 02a0fb8df4
commit ab65bac3ce

View File

@ -31,7 +31,7 @@ def init_lists():
path_to_script = pathlib.Path(os.path.abspath(os.path.dirname(__file__)))
TS_NATIVE_FUNCTIONS_PATH = path_to_script.parent.parent / "aten/src/ATen/native/ts_native_functions.yaml"
with open(TS_NATIVE_FUNCTIONS_PATH) as f:
yaml_ts = yaml.load(f, yaml.Loader)
yaml_ts = yaml.load(f, yaml.SafeLoader)
LAZY_OPS_LIST = set(remove_suffixes(itertools.chain(yaml_ts["full_codegen"], yaml_ts["supported"], yaml_ts["autograd"])))
HAS_SYMINT_SUFFIX = yaml_ts["symint"]
FALLBACK_LIST = {"clamp"}