interop.to_deepinv

Contents

interop.to_deepinv#

bartorch.interop.to_deepinv()#

A LinearOperator as a deepinv.physics.LinearPhysics.

A tensor with one more axis than the operator’s shape is treated as a batch and applied item by item. A_dagger solves by bartorch.optim.CG.

Parameters:
  • op (LinearOperator) – Kept alive as long as the physics.

  • **kwargs – maxiter, lambda_ and tol for A_dagger, overridable per call, and anything LinearPhysics takes.

Return type:

deepinv.physics.LinearPhysics

Examples

>>> physics = interop.to_deepinv(linop.NoncartesianSense(maps, (128, 128), traj=traj))
>>> physics.A_dagger(kspace[None]).shape       # a batch of one
torch.Size([1, 128, 128])