mrpro.utils.broadcast_right
- mrpro.utils.broadcast_right(*x: Tensor) tuple[Tensor, ...] [source]
Broadcasting on the right.
Given multiple tensors, apply broadcasting with unsqueezed on the right. First, tensors are unsqueezed on the right to the same number of dimensions. Then,
torch.broadcast_tensors
is used.`{note} `broadcast_left` is regular `torch.broadcast_tensors` `
Example
Tensors with shapes
(1,2,3), (1,2), (2)
results in tensors with shape(2,2,3)
.- Parameters:
x (
Tensor
) – tensors to broadcast- Returns:
broadcasted tensors (views)