Fix for AMD Devices on Windows.

tested and confirmed working.
This commit is contained in:
traugdor 2024-05-26 10:38:31 -05:00 committed by GitHub
parent 85ed1fb7b8
commit 09f30407ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -630,6 +630,8 @@ def supports_dtype(device, dtype): #TODO
def device_supports_non_blocking(device):
if is_device_mps(device):
return False #pytorch bug? mps doesn't support non blocking
if directml_enabled:
return False #fix for AMD devices on Windows.
return True
def device_should_use_non_blocking(device):