Broadcast tensors to a common shape.
Arguments
- ...
(
nv_tensor)
Tensors to broadcast.
Broadcasting Rules
We follow the standard NumPy broadcasting rules:
If the tensors have different numbers of dimensions, prepend 1s to the shape of the smaller tensor.
For each dimension, if:
the sizes are the same, do nothing.
one of the tensors has size 1, expand it to the corresponding size of the other tensor.
the sizes are different and neither is 1, raise an error.