Skip to content

Commit c5c7bfd

Browse files
committed
Deprecate API
1 parent 650f114 commit c5c7bfd

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

torch_xla/core/xla_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def master_print(*args: Any,
118118
print(*args, file=fd, flush=flush)
119119

120120

121-
@deprecated("Use torch_xla.device instead")
121+
@deprecated("Use torch.device('xla') instead")
122122
def xla_device(n: Optional[int] = None,
123123
devkind: Optional[str] = None) -> torch.device:
124124
"""Returns a given instance of an XLA device.

torch_xla/torch_xla.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import functools
55
import uuid
66
from typing import Any, Callable, List, Optional, Tuple
7+
from typing_extensions import deprecated
78
import weakref
89

910
import torch
@@ -16,6 +17,7 @@
1617
import torch_xla.utils.utils as xu
1718

1819

20+
@deprecated("Use torch.device('xla') instead")
1921
def device(index: int = None) -> torch.device:
2022
"""Returns a given instance of an XLA device.
2123

0 commit comments

Comments
 (0)