Skip to content

Commit

Permalink
numpy.msort no longer exists
Browse files Browse the repository at this point in the history
  • Loading branch information
yairchu committed Jul 9, 2024
1 parent 2517224 commit d2be119
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 3 deletions.
1 change: 0 additions & 1 deletion autograd/numpy/numpy_jvps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion autograd/numpy/numpy_vjps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 0 additions & 1 deletion tests/test_systematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down

0 comments on commit d2be119

Please sign in to comment.