arrlp.get_xp module

arrlp.get_xp(input)[source]

This function returns numpy/cupy depending on the input.

Parameters:

input (bool or array) – If bool, says if using cuda, if array, will detect on cpu or gpu.

Returns:

xp – numpy or cupy.

Return type:

module

Examples

>>> from arrlp import xp
...
>>> get_xp(use_cuda) # with bool
>>> get_xp(array) # with array