Fix TF training arguments instantiation (#8063)

This commit is contained in:
Lysandre Debut 2020-10-26 18:39:25 +00:00 committed by GitHub
parent bc9332b545
commit 3a10764574
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -351,7 +351,7 @@ class TrainingArguments:
if self.run_name is None: if self.run_name is None:
self.run_name = self.output_dir self.run_name = self.output_dir
if self.device.type != "cuda" and self.fp16: if is_torch_available() and self.device.type != "cuda" and self.fp16:
raise ValueError("AMP (`--fp16`) can only be used on CUDA devices.") raise ValueError("AMP (`--fp16`) can only be used on CUDA devices.")
@property @property