Revert "[BE][Easy] enable postponed annotations in torchgen (#129376)"

This reverts commit 494057d6d4e9b40daf81a6a4d7a8c839b7424b14.

Reverted https://github.com/pytorch/pytorch/pull/129376 on behalf of https://github.com/huydhn due to Sorry for reverting your change but I need to revert to cleanly revert https://github.com/pytorch/pytorch/pull/129374, please do a rebase and reland this ([comment](https://github.com/pytorch/pytorch/pull/129375#issuecomment-2197800541))
This commit is contained in:
PyTorch MergeBot
2024-06-29 00:44:24 +00:00
parent 83caf4960f
commit 6063bb9d45
45 changed files with 900 additions and 976 deletions

View File

@ -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 = spec_from_file_location(module_name, file_path)
spec = importlib.util.spec_from_file_location(module_name, file_path)
assert spec is not None
module = module_from_spec(spec)
module = importlib.util.module_from_spec(spec)
sys.modules[module_name] = module
assert spec.loader is not None
assert module is not None