mindspore/docs/api/api_python/mint/mindspore.mint.func_linspac...

27 lines
787 B
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.mint.linspace
=======================
.. py:function:: mindspore.mint.linspace(start, end, steps, *, dtype=None)
创建一个steps个元素的在[start, end]区间内均匀分布的一维tensor。
.. math::
\begin{aligned}
&step = (end - start)/(steps - 1)\\
&output = [start, start+step, start+2*step, ... , end]
\end{aligned}
.. warning::
Atlas训练系列产品暂不支持int16数据类型。
参数:
- **start** (Union[float, int]) - 区间的起始值。
- **end** (Union[float, int]) - 区间的末尾值。
- **steps** (int) - 元素数量。
关键字参数:
- **dtype** (:class:`mindspore.dtype`, 可选) - 返回的数据类型。
返回:
Tensor