vt::astype#

template<typename T, typename U, size_t N>
Tensor<U, N> vt::astype(Tensor<T, N> tensor)#

Convert the tensor to a new data type.

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

  • U – The data type to cast.

  • N – Number of dimensions of the tensor.

Parameters:

tensor – The tensor object.

Returns:

Tensor<U, N>: The new tensor object.