PyTorch
2022-08-04 本文已影响0人
无量儿
1、PyTorch中torch.linspace的详细用法(https://blog.csdn.net/weixin_43593330/article/details/108406866)
线性间距向量
torch.linspace(start, end, steps=100, out=None) → Tensor
返回一个1维张量,包含在区间start和end上均匀间隔的step个点。
输出张量的长度由steps决定。
参数:
start (float) - 区间的起始点
end (float) - 区间的终点
steps (int) - 在start和end间生成的样本数
out (Tensor, optional) - 结果张量
2、