vt::broadcast#

template<typename T, size_t N>
std::tuple<Tensor<T, N>, Tensor<T, N>> vt::broadcast(const Tensor<T, N> &tensor1, const Tensor<T, N> &tensor2)#

Broadcast two tensors to a common shape.

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

  • N – Number of dimensions of the tensor.

Parameters:
  • tensor1 – The first tensor.

  • tensor2 – The second tensor.

Returns:

std::tuple<Tensor<T, N>, Tensor<T, N>>: The broadcasted tensors.