sigpy.to_pytorch¶
-
sigpy.
to_pytorch
(array, requires_grad=True)[source]¶ Zero-copy conversion from numpy/cupy array to pytorch tensor.
For complex array input, returns a tensor with shape + [2], where tensor[…, 0] and tensor[…, 1] represent the real and imaginary.
Parameters: - array (numpy/cupy array) – input.
- requires_grad (bool) – Set .requires_grad output tensor
Returns: PyTorch tensor.