bilby.compat.utils.copy_array

bilby.compat.utils.copy_array(arr)[source]

Return a copy of the passed array. For torch tensors, this uses the clone method, for everything else we use copy.copy to perform a shallow copy.

Parameters:
arr: array-like

The array to copy

Returns:
array-like

The copied array