Fix all is_torch_tpu_available issues (#17936)

* Fix all is_torch_tpu_available
This commit is contained in:
Zachary Mueller
2022-06-29 11:03:33 -04:00
committed by GitHub
parent 77b76672e2
commit 7c4c6f6084
10 changed files with 22 additions and 19 deletions

View File

@@ -20,7 +20,7 @@ from transformers import Trainer, is_torch_tpu_available
from transformers.trainer_utils import PredictionOutput
if is_torch_tpu_available():
if is_torch_tpu_available(check_device=False):
import torch_xla.core.xla_model as xm
import torch_xla.debug.metrics as met

View File

@@ -23,7 +23,7 @@ from transformers import Seq2SeqTrainer, is_torch_tpu_available
from transformers.trainer_utils import PredictionOutput
if is_torch_tpu_available():
if is_torch_tpu_available(check_device=False):
import torch_xla.core.xla_model as xm
import torch_xla.debug.metrics as met

View File

@@ -30,7 +30,7 @@ from transformers.trainer_utils import PredictionOutput
logger = logging.getLogger(__name__)
if is_torch_tpu_available():
if is_torch_tpu_available(check_device=False):
import torch_xla.core.xla_model as xm
import torch_xla.debug.metrics as met