interop.to_deepinv#
- bartorch.interop.to_deepinv()#
Wrap a
LinearOperatoras adeepinv.physics.LinearPhysics.AandA_adjointapply the operator and its adjoint, differentiably; a tensor with one more axis than the operator’s shape is a batch, applied item by item.A_daggersolves bybartorch.optim.CG.- Parameters:
op (LinearOperator) – Operator, kept alive as long as the physics.
**kwargs –
maxiter(30),lambda_(0.0) andtol(1e-6), the defaults ofA_dagger, each overridable per call; anything else is passed toLinearPhysics, such as anoise_model.
- Returns:
The physics, with the operator as its
opattribute.- Return type:
deepinv.physics.LinearPhysics
- Raises:
ImportError –
deepinvis not installed.
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])