Revert "[BE]: Update Typeguard to TypeIs for better type inference (#133814)"

This reverts commit bce0caba7804b0787684dbf1f4e1c4d9e3acded5.

Reverted https://github.com/pytorch/pytorch/pull/133814 on behalf of https://github.com/ezyang due to root cause of internal failures not addressed ([comment](https://github.com/pytorch/pytorch/pull/133814#issuecomment-2302466444))
This commit is contained in:
PyTorch MergeBot
2024-08-21 16:13:34 +00:00
parent 57625bacea
commit 2db28a9611
9 changed files with 22 additions and 22 deletions

View File

@ -4,7 +4,7 @@ import contextlib
import warnings
from dataclasses import dataclass
from typing import Any, Dict, List, Optional, Set, Union, Protocol, Tuple, Sequence, overload, Deque
from typing_extensions import TypeIs
from typing_extensions import TypeGuard
from collections import deque
import torch
@ -354,7 +354,7 @@ class TensorWithFlatten(Protocol):
def is_traceable_wrapper_subclass(t: object) -> TypeIs[TensorWithFlatten]:
def is_traceable_wrapper_subclass(t: object) -> TypeGuard[TensorWithFlatten]:
"""
Returns whether or not a tensor subclass that implements __torch_dispatch__
is 'traceable' with torch.compile.