[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:
Xuehai Pan
2024-06-28 16:28:16 +08:00
committed by PyTorch MergeBot
parent 59eb2897f1
commit 494057d6d4
45 changed files with 977 additions and 901 deletions

View File

@ -1,6 +1,8 @@
from __future__ import annotations
import threading
from contextlib import contextmanager
from typing import Iterator, Optional
from typing import Iterator
# Simple dynamic scoping implementation. The name "parametrize" comes
@ -17,8 +19,8 @@ from typing import Iterator, Optional
class Locals(threading.local):
use_const_ref_for_mutable_tensors: Optional[bool] = None
use_ilistref_for_tensor_lists: Optional[bool] = None
use_const_ref_for_mutable_tensors: bool | None = None
use_ilistref_for_tensor_lists: bool | None = None
_locals = Locals()