mindspore.numpy.ediff1d ======================= .. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/br_base/resource/_static/logo_source.svg :target: https://gitee.com/mindspore/mindspore/blob/br_base/docs/api/api_python/numpy/mindspore.numpy.ediff1d.rst :alt: 查看源文件 .. py:function:: mindspore.numpy.ediff1d(ary, to_end=None, to_begin=None) 计算Tensor中连续元素之间的差值。 参数: - **ary** (Tensor) - 如果需要,将在取差值之前被展平。 - **to_end** (Tensor, scalar, 可选) - 在返回的差值末尾添加的数字。默认值: ``None`` 。 - **to_begin** (Tensor, scalar, 可选) - 在返回的差值开头添加的数字。默认值: ``None`` 。 返回: 差值。 异常: - **TypeError** - 如果输入类型不是上述指定的类型。