sigpy.to_pytorch_function

sigpy.to_pytorch_function(linop, input_iscomplex=False, output_iscomplex=False)[source]

Convert SigPy Linop to PyTorch Function.

The returned function can be treated as a native pytorch function performing the linop operator. The function can be backpropagated, applied on GPU arrays, and has minimal overhead as the underlying arrays are shared without copying. For complex valued input/output, the appropriate options should be set when calling the function.

Parameters:
  • linop (Linop) – linear operator to be converted.
  • input_iscomplex (bool) – whether the PyTorch input represents complex tensor.
  • output_iscomplex (bool) – whether the PyTorch output represents complex tensor.
Returns:

equivalent PyTorch Function.

Return type:

torch.autograd.Function