Remove deprecated _aminmax operator (#125995)

It has been deprecated for a long time.

Co-authored-by: Edward Z. Yang <ezyang@meta.com>
Pull Request resolved: https://github.com/pytorch/pytorch/pull/125995
Approved by: https://github.com/ezyang
This commit is contained in:
cyy
2024-05-12 17:50:17 +00:00
committed by PyTorch MergeBot
parent 037615b989
commit 0116ffae7f
11 changed files with 13 additions and 49 deletions

View File

@ -1219,18 +1219,10 @@ class TestReductions(TestCase):
def test_aminmax(self, device, dtype):
def _amin_wrapper(x, dim=None, keepdims=False):
with self.assertWarnsOnceRegex(UserWarning, "_aminmax is deprecated"):
if dim is None:
return torch._aminmax(x)[0]
else:
return torch._aminmax(x, dim, keepdims)[0]
return torch.aminmax(x, dim=dim, keepdim=keepdims)[0]
def _amax_wrapper(x, dim=None, keepdims=False):
with self.assertWarnsOnceRegex(UserWarning, "_aminmax is deprecated"):
if dim is None:
return torch._aminmax(x)[1]
else:
return torch._aminmax(x, dim, keepdims)[1]
return torch.aminmax(x, dim=dim, keepdim=keepdims)[1]
self._test_minmax_helper(_amin_wrapper, np.amin, device, dtype)
self._test_minmax_helper(_amax_wrapper, np.amax, device, dtype)