mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
There are some I can't easily switch due to reasons like: - Dynamo modelling the guard - BC concerns (for torch.autograd.set_multithreading_enabled) Test Plan: - existing tests Pull Request resolved: https://github.com/pytorch/pytorch/pull/102642 Approved by: https://github.com/albanD
11 lines
224 B
Python
11 lines
224 B
Python
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
|