vt::zeros#

template<typename T = float, size_t N>
Tensor<T, N> vt::zeros(Shape<N> shape, const Order order = Order::C)#

Returns a new array of given shape, filled with zeros.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • shape – Shape of the tensor.

  • order – The order of the tensor.

Returns:

Tensor: The new tensor object.

template<typename T = float>
Tensor<T, 1> vt::zeros(size_t m, const Order order = Order::C)#

Generate a 1D array of zeros.

Template Parameters:

T – Data type of the tensor.

Parameters:
  • m – Size of the tensor.

  • order – The order of the tensor.

Returns:

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

template<typename T = float>
Tensor<T, 2> vt::zeros(size_t m, size_t n, const Order order = Order::C)#

Generate a 2D array of zeros.

Template Parameters:

T – Data type of the tensor.

Parameters:
  • m – Number of rows of the tensor.

  • n – Number of columns of the tensor.

  • order – The order of the tensor.

Returns:

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