"vscode:/vscode.git/clone" did not exist on "43114b89ba75a844ae5a61291a8cf40626a47b6e"
Unverified Commit 55bcd0cb authored by Bram Vanroy's avatar Bram Vanroy Committed by GitHub
Browse files

Raise error when using AMP on non-CUDA device (#7869)

* Raise error when using AMP on non-CUDA device

* make style

* make style
parent e3d2bee8
......@@ -351,6 +351,9 @@ class TrainingArguments:
if self.run_name is None:
self.run_name = self.output_dir
if self.device.type != "cuda" and self.fp16:
raise ValueError("AMP (`--fp16`) can only be used on CUDA devices.")
@property
def train_batch_size(self) -> int:
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment