ivy.broadcast_to(x: ivy.NativeArray, newshape: List[int], f: Optional[ivy.Framework] = None) → ivy.NativeArray[source]

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

  • 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.


Newly broadcast array.

Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty