range

dragon.vm.tensorflow.range(
  start,
  limit=None,
  delta=1,
  dtype='int64',
  name=None
)[source]

Return a tensor with evenly spaced values within a interval.

Specify start and limit to determine an interval:

x = tf.range(2, 4)  # [2, 3]

If limit is None, interval \([0, start)\) will be taken instead:

x = tf.range(5)  # [0, 1, 2, 3, 4]

Set delta to make the strides:

x = tf.range(5, delta=2)  # [0, 2, 4]
Parameters:
  • start (number) – The start of interval.
  • limit (number, optional) – The end of interval.
  • delta (number, optional, default=1) – The spacing between two elements.
  • dtype (str, optional, default='int64') – The optional data type.
  • name (str, optional) – A optional name for the operation.
Returns:

dragon.Tensor – The output tensor.