2.4K Star 8.2K Fork 4.4K

GVPMindSpore / mindspore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
sinc_doc.yaml 978 Bytes
一键复制 编辑 原始数据 按行查看 历史
宦晓玲 提交于 2024-03-01 11:47 . modify the formula inconsistence 2.3
sinc:
description: |
Computes the normalized sinc of input.
.. math::
out_i = \begin{cases} \frac{sin(\pi input_i)}{\pi input_i} & input_i\neq 0\\
1 & input_i=0 \end{cases}
Args:
input (Tensor): The input Tensor.
Returns:
Tensor, has the same shape as the `input`. The dtype of output is float32 when dtype of `input` is in
[int, bool]. Otherwise output has the same dtype as the `input`.
Raises:
TypeError: If `input` is not a Tensor.
Supported Platforms:
``Ascend`` ``GPU`` ``CPU``
Examples:
>>> import mindspore
>>> import numpy as np
>>> from mindspore import Tensor, ops
>>> input = Tensor(np.array([0.62, 0.28, 0.43, 0.62]), mindspore.float32)
>>> output = ops.sinc(input)
>>> print(output)
[0.47735003 0.8759357 0.7224278 0.47735003]
Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore
master

搜索帮助