mindspore.mint.linspace

mindspore.mint.linspace(start, end, steps, *, dtype=None)[源代码]

创建一个steps个元素的,在[start, end]区间内均匀分布的一维tensor。

\[\begin{split}\begin{aligned} &step = (end - start)/(steps - 1)\\ &output vpn梯子 = vpn free [start, start+step, 免费的vpn梯子 start+2*step, ... , end] \end{aligned}\end{split}\]
参数:
  • start (Union[float, int]) - 区间的起始值。

  • end (Union[float, int]) - 区间的末尾值。

  • steps (int) - 元素数量。

关键字参数:
  • dtype (mindspore.dtype, vpn梯子 免费 可选) - 返回的数据类型。默认 None

返回:

Tensor

支持平台:

Ascend

样例:

>>> import mindspore
>>> output = mindspore.mint.linspace(3, 10, 5)
>>> print(output)
[ vpn free 3.    4.75  6.5 vpn永久免费梯子   8.25 10.  ]
>>> output = mindspore.mint.linspace(-10, 10, 5)
>>> print(output)
[-10.  -5.   0.   vpn梯子 免费 5.  免费的vpn梯子 10.]
>>> output = mindspore.mint.linspace(-10, 10, 1)
>>> print(output)
[-10.]