haojin2 commented on a change in pull request #17624: [Numpy] add ediff1d
URL: https://github.com/apache/incubator-mxnet/pull/17624#discussion_r381825160
##########
File path: python/mxnet/ndarray/numpy/_op.py
##########
@@ -6758,6 +6758,67 @@ def diff(a, n=1, axis=-1, prepend=None, append=None):
# pylint: disable=redefin
return _npi.diff(a, n=n, axis=axis)
+@set_module('mxnet.ndarray.numpy')
+def ediff1d(ary, to_end=None, to_begin=None):
+ """
+ The differences between consecutive elements of an array.
+
+ Parameters
+ ----------
+ ary : ndarray
+ If necessary, will be flattened before the differences are taken.
+ to_end : ndarray or scalar, optional
+ Number(s) to append at the end of the returned differences.
+ to_begin : ndarray or scalar, optional
+ Number(s) to prepend at the beginning of the returned differences.
+
+ Returns
+ -------
+ ediff1d : ndarray
+ The differences. Loosely, this is ``ary.flat[1:] - ary.flat[:-1]``.
+
+ See Also
+ --------
+ diff, gradient
Review comment:
get rid of this section in all wrappers.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services