From d2be11931fb71ced9ae990b8025067e6f2d0bac8 Mon Sep 17 00:00:00 2001 From: Yair Chuchem Date: Tue, 9 Jul 2024 10:30:42 +0300 Subject: [PATCH] numpy.msort no longer exists --- autograd/numpy/numpy_jvps.py | 1 - autograd/numpy/numpy_vjps.py | 1 - tests/test_systematic.py | 1 - 3 files changed, 3 deletions(-) diff --git a/autograd/numpy/numpy_jvps.py b/autograd/numpy/numpy_jvps.py index 38c6e7353..3fe7d29be 100644 --- a/autograd/numpy/numpy_jvps.py +++ b/autograd/numpy/numpy_jvps.py @@ -210,7 +210,6 @@ def fwd_grad_sort(g, ans, x, axis=-1, kind='quicksort', order=None): sort_perm = anp.argsort(x, axis, kind, order) return g[sort_perm] defjvp(anp.sort, fwd_grad_sort) -defjvp(anp.msort, lambda g, ans, x: fwd_grad_sort(g, ans, x, axis=0)) def fwd_grad_partition(g, ans, x, kth, axis=-1, kind='introselect', order=None): partition_perm = anp.argpartition(x, kth, axis, kind, order) diff --git a/autograd/numpy/numpy_vjps.py b/autograd/numpy/numpy_vjps.py index d486400c9..38f220616 100644 --- a/autograd/numpy/numpy_vjps.py +++ b/autograd/numpy/numpy_vjps.py @@ -560,7 +560,6 @@ def grad_sort(ans, x, axis=-1, kind='quicksort', order=None): sort_perm = anp.argsort(x, axis, kind, order) return lambda g: unpermuter(g, sort_perm) defvjp(anp.sort, grad_sort) -defvjp(anp.msort, grad_sort) # Until multi-D is allowed, these are the same. def grad_partition(ans, x, kth, axis=-1, kind='introselect', order=None): #TODO: Cast input with np.asanyarray() diff --git a/tests/test_systematic.py b/tests/test_systematic.py index 0ba80c2a2..3a65e3e79 100644 --- a/tests/test_systematic.py +++ b/tests/test_systematic.py @@ -155,7 +155,6 @@ def test_fmin(): combo_check(np.fmin, [0, 1])( [R(1), R(1,4), R(3, 4)]) def test_sort(): combo_check(np.sort, [0])([R(1), R(7)]) -def test_msort(): combo_check(np.msort, [0])([R(1), R(7)]) def test_partition(): combo_check(np.partition, [0])( [R(7), R(14)], kth=[0, 3, 6])