Update devices.py

This commit is contained in:
FNSpd 2023-03-21 14:45:39 +04:00 committed by GitHub
parent a9fed7c364
commit 254d994643
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -110,7 +110,7 @@ def autocast(disable=False):
if disable: if disable:
return contextlib.nullcontext() return contextlib.nullcontext()
if dtype == torch.float32 or shared.cmd_opts.precision == "full": if dtype == torch.float32 or shared.cmd_opts.precision == "full" or shared.cmd_opts.upcast_sampling:
return contextlib.nullcontext() return contextlib.nullcontext()
return torch.autocast("cuda") return torch.autocast("cuda")