Skip to content

Commit 624ad9b

Browse files
internal developermryszt
authored andcommitted
Support optimizer capturable on hpu and xpu
Cherry-pick: pytorch#132119 Change-Id: Id99c3f13fc69d8ac0a714befd34de34851a69dbd
1 parent 871cc5e commit 624ad9b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch/optim/optimizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def _get_scalar_dtype(is_fused=None):
217217

218218
def _get_capturable_supported_devices(supports_xla: bool = True) -> List[str]:
219219
r"""Return the device type list that supports capturable optimizer."""
220-
capturable_supported_devices = ["cuda"]
220+
capturable_supported_devices = ["cuda", "xpu", "hpu"]
221221
if not torch.jit.is_scripting():
222222
capturable_supported_devices.append(torch._C._get_privateuse1_backend_name())
223223
if supports_xla:

0 commit comments

Comments
 (0)