Document feedback

Question document fragment

When a question document fragment contains a formula, it is displayed as a space.

Submission type
issue

It's a little complicated...

I'd like to ask someone.

Please select the submission type

Problem type
Specifications and Common Mistakes

- Specifications and Common Mistakes:

- Misspellings or punctuation mistakes,incorrect formulas, abnormal display.

- Incorrect links, empty cells, or wrong formats.

- Chinese characters in English context.

- Minor inconsistencies between the UI and descriptions.

- Low writing fluency that does not affect understanding.

- Incorrect version numbers, including software package names and version numbers on the UI.

Usability

- Usability:

- Incorrect or missing key steps.

- Missing main function descriptions, keyword explanation, necessary prerequisites, or precautions.

- Ambiguous descriptions, unclear reference, or contradictory context.

- Unclear logic, such as missing classifications, items, and steps.

Correctness

- Correctness:

- Technical principles, function descriptions, supported platforms, parameter types, or exceptions inconsistent with that of software implementation.

- Incorrect schematic or architecture diagrams.

- Incorrect commands or command parameters.

- Incorrect code.

- Commands inconsistent with the functions.

- Wrong screenshots.

- Sample code running error, or running results inconsistent with the expectation.

Risk Warnings

- Risk Warnings:

- Lack of risk warnings for operations that may damage the system or important data.

Content Compliance

- Content Compliance:

- Contents that may violate applicable laws and regulations or geo-cultural context-sensitive words and expressions.

- Copyright infringement.

Please select the type of question

Problem description

Describe the bug so that we can quickly locate the problem.

mindspore.ops.arange

mindspore.ops.arange(start=0, stop=None, step=1, rtype=None)[source]

Returns evenly spaced values within a given interval.

Parameters
  • start (Union[int, float]) – Start value of interval. The interval includes this value. When stop is None, start must be greater than 0, and the interval is [0,start). When stop is not None, start must be less than stop.

  • stop (Union[int, float], optional) – End value of interval. The interval does not include this value. Default is None.

  • step (Union[int, float], optional) – Spacing between values. For any output out, this is the distance between two adjacent values, out[i+1]out[i]. The default step size is 1. If step is specified as a position argument, start must also be given.

  • rtype (Union[mindspore.dtype, str], optional) – Designated tensor type. If rtype is None, the data type of the new tensor will be inferred from start, stop and step. Default is None.

Returns

Tensor with evenly spaced values.

Raises
  • TypeError – If input arguments have types not specified above.

  • ValueError – If input arguments have values not specified above.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore.ops as ops
>>> print(ops.arange(0, 5, 1))
[0 1 2 3 4]
>>> print(ops.arange(3))
[0 1 2]
>>> print(ops.arange(start=0, stop=3))
[0 1 2]
>>> print(ops.arange(0, stop=3, step=0.5))
[0.  0.5 1.  1.5 2.  2.5]