Broadcasts an array to a new shape by replicating the data along new or size-1 axes.
Arguments
- x
(
arrayish)
One input. Can be any data type. An R value materializes at its default data type.- shape
(
integer())
Target shape. The size of each mapped axis must either match the size of the corresponding axis ofx, or that axis ofxmust have size 1.- broadcast_axes
(
integer())
Maps each axis ofxto an axis of the output. Must have length equal to the number of axes ofx.
Value
(arrayish)
Has the same data type as the input and the given shape.
StableHLO
Lowers to hlo_broadcast_in_dim(), specified under
broadcast_in_dim.