You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.ops.Erf.rst.txt 984 B

12345678910111213141516171819202122232425262728293031323334353637
  1. mindspore.ops.Erf
  2. =================
  3. .. py:class:: mindspore.ops.Erf(*args, **kwargs)
  4. 按元素计算 `x` 的高斯误差函数。
  5. .. math::
  6. erf(x)=\frac{2} {\sqrt{\pi}} \int\limits_0^{x} e^{-t^{2}} dt
  7. **输入:**
  8. **x** (Tensor) - 用于计算高斯误差函数的Tensor。数据类型必须为float16或float32。shape为 :math:`(N,*)`,其中 :math:`*` 表示任意的附加维度数,其秩应小于8。
  9. **输出:**
  10. Tensor,具有与 `x` 相同的数据类型和shape。
  11. **异常:**
  12. **TypeError:** `x` 的数据类型既不是float16也不是float32。
  13. **支持平台:**
  14. ``Ascend`` ``GPU``
  15. **样例:**
  16. .. code-block::
  17. >>> x = Tensor(np.array([-1, 0, 1, 2, 3]), mindspore.float32)
  18. >>> erf = ops.Erf()
  19. >>> output = erf(x)
  20. >>> print(output)
  21. [-0.8427168 0. 0.8427168 0.99530876 0.99997765]