Broadcast one or more tensors against each other to a common shape.
Computes the joint shape via lucid.broadcast_shapes and returns
a tuple of views produced by Tensor.broadcast_to, preserving
autograd tracking on every input tensor.
Parameters
*tensorsTensorZero or more tensors whose shapes are broadcast-compatible.
Returns
tuple[Tensor, ...]Tuple of broadcasted tensor views sharing the common shape.
Raises
TypeErrorIf any argument is not a
Tensor.lucid._C.engine.ShapeMismatchIf the input tensor shapes cannot be broadcast together.
Examples
>>> import lucid
>>> x = lucid.arange(3).reshape(3, 1)
>>> y = lucid.arange(2).reshape(1, 2)
>>> bx, by = lucid.broadcast_tensors(x, y)
>>> bx.shape, by.shape
((3, 2), (3, 2))