mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Pull Request resolved: https://github.com/pytorch/pytorch/pull/155812 Approved by: https://github.com/Skylion007 ghstack dependencies: #155782, #155783
16 lines
255 B
Python
16 lines
255 B
Python
# mypy: allow-untyped-defs
|
|
from typing import TypeVar
|
|
|
|
import torch
|
|
|
|
|
|
T = TypeVar("T")
|
|
|
|
|
|
# returns if all are the same mode
|
|
def all_same_mode(modes):
|
|
return all(tuple(mode == modes[0] for mode in modes))
|
|
|
|
|
|
no_dispatch = torch._C._DisableTorchDispatch
|