2.4K Star 8.2K Fork 4.4K

GVPMindSpore / mindspore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
next_after_doc.yaml 1.98 KB
一键复制 编辑 原始数据 按行查看 历史
next_after:
description: |
Returns the next representable floating-point value after `input` towards `other` element-wise.
Say there are two float32 numbers :math:`a`, :math:`b`, and let the
representable delta of float32 datatype is :math:`eps`. If :math:`a < b`,
then the next representable of :math:`a` towards :math:`b` is :math:`a+eps`,
the next representable of :math:`b` towards :math:`a` is :math:`b-eps`.
.. math::
out_{i} = nextafter({input_{i}, other_{i}})
For more detailed information, refer to `A Self Regularized Non-Monotonic Neural Activation Function <https://arxiv.org/abs/1908.08681>`_.
Args:
input (Tensor): The first input tensor. The shape of tensor is :math:`(N,*)` where :math:`*` means,
any number of additional dimensions. Must be one of the following types: float32, float64.
other (Tensor): The second input tensor. The shape of tensor is :math:`(N,*)` where :math:`*` means,
any number of additional dimensions. Must be one of the following types: float32, float64.
Returns:
Tensor, has the same shape and data type as `input`.
Raises:
TypeError: If neither `input` nor `other` is a Tensor.
TypeError: If the dtype of `input` and `other` is not one of: float32, float64.
TypeError: If the dtypes of `input` and `other` are not same.
ValueError: If `input`'s shape is not the same as `other`.
Supported Platforms:
``Ascend`` ``GPU`` ``CPU``
Examples:
>>> import mindspore
>>> import numpy as np
>>> from mindspore import Tensor, ops
>>> input_ = Tensor(np.asarray([0.0]), mindspore.float32)
>>> other_ = Tensor(np.asarray([0.1]), mindspore.float32)
>>> output_ = ops.nextafter(input_, other_)
>>> print(output_)
[1.e-45]
Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore
master

搜索帮助