Skip to content

Commit 2ee9895

Browse files
xinyu-intelpytorchmergebot
authored andcommitted
Support optimizer capturable on hpu and xpu (#132119)
as title Pull Request resolved: #132119 Approved by: https://github.com/jgong5, https://github.com/janeyx99
1 parent f936e68 commit 2ee9895

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
@@ -210,7 +210,7 @@ def _get_scalar_dtype(is_fused=None):
210210

211211
def _get_capturable_supported_devices(supports_xla: bool = True) -> List[str]:
212212
r"""Return the device type list that supports capturable optimizer."""
213-
capturable_supported_devices = ["cuda"]
213+
capturable_supported_devices = ["cuda", "xpu", "hpu"]
214214
if not torch.jit.is_scripting():
215215
capturable_supported_devices.append(torch._C._get_privateuse1_backend_name())
216216
if supports_xla:

0 commit comments

Comments
 (0)