Don't init TPU device twice (#4916)

This commit is contained in:
Lysandre Debut
2020-06-10 15:53:15 -04:00
committed by GitHub
parent ef2dcdccaa
commit 466aa57a45

View File

@@ -71,9 +71,7 @@ except ImportError:
try: try:
import torch_xla.core.xla_model as xm import torch_xla.core.xla_model as xm # noqa: F401
tpu_device = xm.xla_device()
if _torch_available: if _torch_available:
_torch_tpu_available = True # pylint: disable= _torch_tpu_available = True # pylint: disable=