mindspore.mint.linspace
- mindspore.mint.linspace(start, end, steps, *, dtype=None)[source]
Generate a one-dimensional tensor with steps elements, evenly distributed in the interval [start, end].
Warning
Atlas training series does not support int16 dtype currently.
- Parameters
- Keyword Arguments
dtype (mindspore.dtype, optional) – The data type returned.
- Returns
Tensor
- Supported Platforms:
Ascend
Examples
>>> import mindspore >>> output = mindspore.mint.linspace(3, 10, 5) >>> print(output) [ 3. 4.75 6.5 8.25 10. ] >>> output = mindspore.mint.linspace(-10, 10, 5) >>> print(output) [-10. -5. 0. 5. 10.] >>> output = mindspore.mint.linspace(-10, 10, 1) >>> print(output) [-10.]