mrinufft._array_compat

mrinufft._array_compat#

Array libraries compatibility utils.

Functions

auto_cast

Cast an array or a tensor to the desired dtype.

get_array_module

Get the module of the array.

is_cuda_array

Check if var implement the CUDA Array interface.

is_cuda_tensor

Check if var is a CUDA tensor.

is_host_array

Check if var is a host contiguous np array.

pin_memory

Create a copy of the array in pinned memory.

with_numpy

Ensure the function works internally with numpy array.

with_numpy_cupy

Ensure the function works internally with numpy or cupy array.

with_tensorflow

Ensure the function works internally with tensorflow array.

with_torch

Ensure the function works internally with Torch.