代码拉取完成,页面将自动刷新
torch.bartlett_window(
window_length,
periodic=True,
*,
dtype=None,
layout=torch.strided,
device=None,
requires_grad=False
) -> Tensor
更多内容详见torch.bartlett_window。
mindspore.ops.bartlett_window(
window_length,
periodic=True,
dtype=mstype.float32
) -> Tensor
更多内容详见mindspore.ops.bartlett_window。
PyTorch:返回size与window_length相同的巴特兰窗,periodic参数确定返回窗口是否会删除对称窗口的最后一个重复值。
MindSpore:MindSpore此API实现功能与PyTorch基本一致,精度稍有差异。
分类 | 子类 | PyTorch | MindSpore | 差异 |
---|---|---|---|---|
参数 | 参数1 | window_length | window_length | PyTorch中为int类型,MindSpore中为Tensor |
参数2 | periodic | periodic | - | |
参数3 | dtype | dtype | - | |
参数4 | layout | - | 不涉及 | |
参数5 | device | - | 不涉及 | |
参数6 | requires_grad | - | MindSpore无此参数,默认支持反向求导 |
# PyTorch
import torch
torch_output = torch.bartlett_window(5, periodic=True)
print(torch_output.numpy())
#[0. 0.4 0.8 0.79999995 0.39999998]
# MindSpore
import mindspore
from mindspore import Tensor
window_length = Tensor(5, mindspore.int32)
ms_output = mindspore.ops.bartlett_window(window_length, periodic=True)
print(ms_output.asnumpy())
#[0. 0.4 0.8 0.8 0.4]
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。