mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Remove allow-untyped-defs from torch.fx.experimental.symbolic_shapes (#137019)
Signed-off-by: Edward Z. Yang <ezyang@meta.com> Pull Request resolved: https://github.com/pytorch/pytorch/pull/137019 Approved by: https://github.com/Skylion007 ghstack dependencies: #136934, #136935, #136972
This commit is contained in:
committed by
PyTorch MergeBot
parent
cc8f1cddd4
commit
6bd9d37266
@ -19,7 +19,7 @@ from typing import (
|
||||
TYPE_CHECKING,
|
||||
Union,
|
||||
)
|
||||
from typing_extensions import TypeAlias
|
||||
from typing_extensions import TypeAlias, TypeGuard
|
||||
|
||||
import torch
|
||||
from torch._C._autograd import CreationMeta
|
||||
@ -143,7 +143,7 @@ def is_sparse_compressed(t):
|
||||
return isinstance(t, torch.Tensor) and is_sparse_compressed_layout(t.layout)
|
||||
|
||||
|
||||
def is_sparse_any(t):
|
||||
def is_sparse_any(t: object) -> TypeGuard[torch.Tensor]:
|
||||
return is_sparse_coo(t) or is_sparse_compressed(t)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user