vt::arange#

template<typename T = float>
Tensor<T, 1> vt::arange(int step, const Order order = Order::C)#

Returns a new 1D array and filled with an increasing sequence.

Template Parameters:

T – Data type of the tensor.

Parameters:
  • step – The size of the tensor.

  • order – The order of the tensor.

Returns:

Tensor: The new tensor object.

template<typename T = float>
Tensor<T, 1> vt::arange(T start, T end, T step, const Order order = Order::C)#

Generate a sequence of numbers from start to end with a given step size.

Template Parameters:

T – Data type of the tensor.

Parameters:
  • start – The starting value of the sequence.

  • end – The end value of the sequence.

  • step – The step size of the sequence.

  • order – The order of the tensor.

Returns:

Tensor<T, 1>: The new tensor object.

template<typename T>
Tensor<T*, 1> vt::arange(T *start, T *end, int step, const Order order = Order::C)#

Generate a sequence of pointers from start to end with a given step size.

Template Parameters:

T – Data type of the tensor.

Parameters:
  • start – The starting value of the sequence.

  • end – The end value of the sequence.

  • step – The step size of the sequence.

  • order – The order of the tensor.

Returns:

Tensor<T*, 1>: The new tensor object.