vt::broadcast_to#

template<typename T, size_t N>
Tensor<T, N> vt::broadcast_to(const Tensor<T, N> &tensor, const Shape<N> &broadcast_shape)#

Broadcast a tensor to a new shape.

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

  • N – Number of dimensions of the tensor.

Parameters:
  • tensor – The tensor to be broadcasted.

  • broadcast_shape – The new shape of the tensor.

Returns:

tensor: The new tensor object.