Broadcast a tensor to a compatible shape
Details
Labels are retained on dimensions whose sizes do not change. Labels are dropped from singleton dimensions that are expanded because a single input label cannot identify multiple output positions.
Examples
x <- cuda_tensor(1:3, device = "cpu")
tensor_broadcast_to(x, c(2, 3))
#> <cudatensor[2x3] device=cpu backend=base dtype=integer>
#> [,1] [,2] [,3]
#> [1,] 1 2 3
#> [2,] 1 2 3