Skip to content

Commit 87497c3

Browse files
committed
Deprecate API
1 parent c8c1b4b commit 87497c3

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
@@ -135,7 +135,7 @@ def master_print(*args: Any,
135135
print(*args, file=fd, flush=flush)
136136

137137

138-
@deprecated("Use torch_xla.device instead")
138+
@deprecated("Use torch.device('xla') instead")
139139
def xla_device(n: Optional[int] = None,
140140
devkind: Optional[str] = None) -> torch.device:
141141
"""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)