bilby.compat.utils.promote_to_array
- bilby.compat.utils.promote_to_array(args, xp, skip=None)[source]
Promote arguments to arrays using the specified array module.
- Parameters:
- args: tuple
Tuple of arguments to promote.
- xp: module
The array module (namespace) to use for promotion.
- skip: int, optional
Number of trailing arguments to skip promotion for. Defaults to None (promote all arguments).
- Returns:
- tuple
Arguments with the first (len(args) - skip) elements promoted to arrays using the specified module.
Notes
This function cannot handle manual specification of devices. Arrays are promoted to the default device of the specified array module unless the
BILBY_DEVICEenvironment variable is set, e.g., to ignore a GPU when usingpytorch, users can specifyBILBY_DEVICE=cpu.