Files
pytorch/torch/utils/_mode_utils.py
2025-06-12 23:51:42 +00:00

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