Sign in
android
/
platform
/
external
/
pytorch
/
7ce5b5767c
/
.
/
torch
/
utils
/
_mode_utils.py
blob: 91c0e07b3d9345094e532beb4b94c1ff3c4b26a6 [
file
] [
log
] [
blame
]
# 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