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) result in tensors with shapes (2, 2, 3).

Parameters:

x (Tensor) – Tensors to broadcast.

Returns:

Broadcasted tensors (views).