mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
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:
@ -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)
|
||||
|
Reference in New Issue
Block a user