mars.tensor.
broadcast_to
Broadcast an tensor to a new shape.
tensor (array_like) – The tensor to broadcast.
shape (tuple) – The shape of the desired array.
broadcast
Tensor
ValueError – If the tensor is not compatible with the new shape according to Mars’s broadcasting rules.
Examples
>>> import mars.tensor as mt
>>> x = mt.array([1, 2, 3]) >>> mt.broadcast_to(x, (3, 3)).execute() array([[1, 2, 3], [1, 2, 3], [1, 2, 3]])