mrpro.utils.unsqueeze_right

mrpro.utils.unsqueeze_right(x: Tensor, n: int) Tensor[source]

Unsqueeze multiple times in the rightmost dimension.

Example

Tensor with shape (1,2,3) and n=2 would result in tensor with shape (1,2,3,1,1).

Parameters:
  • x (Tensor) – tensor to unsqueeze

  • n (int) – number of times to unsqueeze

Returns:

unsqueezed tensor (view)