Sign in
android
/
platform
/
external
/
pytorch
/
bae409388cfc20cce656bf7b671e45aaf81dd1c8
/
.
/
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