Do not sort `axis` of `gradient`
import numpy
+import numpy.core.numeric as nx
import cupy
from cupy.core import _routines_math as _math
@@ -341,7 +342,7 @@ def gradient(f, *varargs, axis=None, edge_order=1):
if axis is None:
axes = tuple(range(ndim))
else:
- axes = internal._normalize_axis_indices(axis, ndim)
+ axes = nx.normalize_axis_tuple(axis, ndim)
len_axes = len(axes)
n = len(varargs)
