Sign in
android
/
platform
/
external
/
pytorch
/
42f94d7e9f1afe9d5b1de5c08758c3fc52fde3fe
/
.
/
torch
/
utils
/
_mode_utils.py
blob: c6e3cbb5e9403cb3dda102a85665da15a4f10482 [
file
] [
log
] [
blame
]
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