mindspore.ops.Range

class mindspore.ops.Range(maxlen=1000000)[source]

Creates a sequence of numbers that begins at start and extlimits by increments of delta up to but not including limit.

Refer to mindspore.ops.range() for more details.

Parameters

maxlen (int, optional) – Memory that can fit maxlen many elements will be allocated for the output. Optional, must be positive. Default: 1000000. If the output has more than maxlen elements, a runtime error will occur.

Inputs:
  • start (Tensor) - A scalar Tensor. The first number in the sequence. Must have type: int32 ,int64, float32 or float64.

  • limit (Tensor) - A scalar Tensor. Upper limit of the sequence, exclusive. Must have type: int32 ,int64, float32 or float64.

  • delta (Tensor) - A scalar Tensor. Number that increments start. Must have type: int32 ,int64, float32 or float64.

Outputs:

A 1-D Tensor, with the same type as the inputs.

Supported Platforms:

GPU CPU

Examples

>>> start = Tensor(0, mstype.int32)
>>> limit = Tensor(10, mstype.int32)
>>> delta = Tensor(4, mstype.int32)
>>> output = ops.Range()(start, limit, delta)
>>> print(output)
[0 4 8]