mindspore2022/docs/api/api_python/ops/mindspore.ops.func_arange.rst

22 lines
946 B
ReStructuredText
Raw 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.ops.arange
===============================
.. py:function:: mindspore.ops.arange(start=0, stop=None, step=1, rtype=None)
根据给定的范围返回指定均匀间隔的数据。
**参数:**
- **start** (Union[int, float]) - 指定范围的起始值范围包含该值。类型为int或float。
- **stop** (Union[int, float]) - 指定范围的结束值范围不包含该值。类型为int或float。
- **step** (Union[int, float]) - 指定取值的间隔。类型为int或float。
- **rtype** (Union[mindspore.dtype, str]) - 指定返回数据的类型,如果不指定,则会根据 `start``stop``step` 的值推断类型。
**返回:**
Tensor值是均匀间隔的数据类型为给定或推断的结果。
**异常:**
- **TypeError** - `start``stop``step` 的类型不是int或float。
- **ValueError** - `start` 的值大于等于 `stop`