linop.stack

Contents

linop.stack#

bartorch.linop.stack()#

Apply every operator to the same input and stack the outputs on a new axis.

torch.stack of the outputs: the codomain gains an axis of length len(ops).

Parameters:
  • ops (sequence of LinearOperator) – At least one, all with the same domain and codomain.

  • axis (int, default=0) – Position of the new axis in the codomain.

Return type:

LinearOperator

Raises:

ValueError – When the shapes differ, or the new axis would exceed BART’s dimension count.

Examples

>>> A = stack([FFT(shape, axes=-1), Identity(shape)])
>>> A.oshape == (2,) + shape
True