ivy.broadcast_to(x, newshape, f=None)[source]

Broadcast the input tensor to newshape, adding dimensions of size 1 where the dimensions do not align.

Parameters
• x (array) – Tensor to be broadcast to new shape.

• newshape (sequence of ints) – The new shape the tensor should be broadcast to.

• f (ml_framework, optional) – Machine learning framework. Inferred from inputs if None.

Returns