mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[BE][Easy] enable postponed annotations in torchgen
(#129376)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/129376 Approved by: https://github.com/ezyang ghstack dependencies: #129375
This commit is contained in:
committed by
PyTorch MergeBot
parent
59eb2897f1
commit
494057d6d4
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
import importlib.util
|
||||
import os
|
||||
import sys
|
||||
from importlib.util import module_from_spec, spec_from_file_location
|
||||
from itertools import chain
|
||||
from pathlib import Path
|
||||
|
||||
@ -18,9 +18,9 @@ you are in the root directory of the Pytorch git repo"""
|
||||
if not file_path.exists():
|
||||
raise Exception(err_msg) # noqa: TRY002
|
||||
|
||||
spec = importlib.util.spec_from_file_location(module_name, file_path)
|
||||
spec = spec_from_file_location(module_name, file_path)
|
||||
assert spec is not None
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
module = module_from_spec(spec)
|
||||
sys.modules[module_name] = module
|
||||
assert spec.loader is not None
|
||||
assert module is not None
|
||||
|
Reference in New Issue
Block a user