broadcast_to

broadcast_to(x: array, /, shape: Tuple[int, ...]) array

Broadcasts an array to a specified shape.

Parameters
  • x (array) – array to broadcast.

  • shape (Tuple[int, ...]) – array shape. Must be compatible with x (see Broadcasting). If the array is incompatible with the specified shape, the function should raise an exception.

Returns

out (array) – an array having a specified shape. Must have the same data type as x.