Python wrappers
Public Python APIs implemented by this engine symbol.Broadcast a tensor to a larger shape following NumPy rules.
The input shape is right-aligned with shape; size-1 dimensions are
replicated and newly prepended axes are inserted. If a is not
contiguous a copy is made before the broadcast operation runs.
See Also
expand_op (alias), BroadcastBackward.
Parameters
aTensorImplPtrInput tensor.
shapeShapeTarget shape. Must be NumPy-broadcast-compatible with
a.shape.Returns
TensorImplPtrA tensor of shape shape whose values are replicated from a.
Raises
ShapeMismatchIf
a.shape cannot be broadcast to shape (any mismatching axis where neither side is 1).Examples
broadcast_to_op([1, 2, 3], (4, 3)) produces a 4x3 tensor where every
row equals [1, 2, 3].