mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
See #127836 for details. Pull Request resolved: https://github.com/pytorch/pytorch/pull/127846 Approved by: https://github.com/ezyang ghstack dependencies: #127842, #127843, #127844, #127845
12 lines
251 B
Python
12 lines
251 B
Python
# mypy: allow-untyped-defs
|
|
import torch
|
|
from typing import TypeVar
|
|
|
|
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
|