mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[BE] wrap deprecated function/class with typing_extensions.deprecated
(#127689)
Use `typing_extensions.deprecated` for deprecation annotation if possible. Otherwise, add `category=FutureWarning` to `warnings.warn("message")` if the category is missing. Note that only warnings that their messages contain `[Dd]eprecat(ed|ion)` are updated in this PR. Resolves #126888 - #126888 This PR is split from PR #126898. - #126898 ------ Pull Request resolved: https://github.com/pytorch/pytorch/pull/127689 Approved by: https://github.com/Skylion007
This commit is contained in:
committed by
PyTorch MergeBot
parent
c1dd3a615f
commit
67ef2683d9
@ -338,7 +338,7 @@ $1: f32[2] = torch._ops.prims.sin.default($0)""")
|
||||
prims.mul(torch.randn(2), 1 + 1j)
|
||||
|
||||
def test_check_deprecation_warning(self):
|
||||
with self.assertWarnsRegex(DeprecationWarning, 'will be removed in the future'):
|
||||
with self.assertWarnsRegex(FutureWarning, 'will be removed in the future'):
|
||||
torch._prims_common.check(True, lambda: 'message')
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user