Commit a3169768 authored by ptrblck's avatar ptrblck Committed by mcarilli
Browse files

raise exception if cudnn is disabled (#305)

parent df099a4b
......@@ -303,6 +303,10 @@ def initialize(
if not enabled:
return models, optimizers
if not torch.backends.cudnn.enabled:
raise RuntimeError(
"Amp requires torch.backends.cudnn.enabled = True")
if opt_level not in opt_levels:
raise RuntimeError(
"Unexpected optimization level {}. ".format(opt_level) +
......
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