arrlp.FunctionArray module

class arrlp.FunctionArray(*, ndims: int, cpu_function: LambdaType, par_function: LambdaType, gpu_function: LambdaType, out_function: LambdaType, ini_function: LambdaType, cpu_loop: LambdaType = False, par_loop: LambdaType = False, gpu_loop: LambdaType = False, use_joblib: bool = True, remove_parallel: bool = False, remove_cuda: bool = False)[source]

Bases: object

This class defines a function for various array configurations.

Parameters:
  • ndims (int) – Number of dimensions of the base array.

  • cpu_function (types.FunctionType) – Cpu function.

  • par_function (types.FunctionType) – Par function.

  • gpu_function (types.FunctionType) – Gpu function.

  • out_function (types.FunctionType) – Function defining output array.

  • ini_function (types.FunctionType) – Function defining initialization kwargs.

  • cpu_loop (bool) – True if cpu_function applyies default loop.

  • par_loop (bool) – True if par_function applyies default loop.

  • gpu_loop (bool) – True if gpu_function applyies default loop.

  • use_joblib (bool) – True to use joblib for parallel processes in parallel loop.

  • remove_parallel (bool) – True if the parallel implementation is slower than normal python.

  • remove_cuda (bool) – True if the cuda implementation is slower than normal python.

Examples

>>> from arrlp import FunctionArray
...
>>> instance = FunctionArray(TODO)
property axes
channels: bool
checks(out, stacks, channels, parallel, cuda, test)[source]

Make checks on asked mode

cpu_function: LambdaType
cpu_loop: LambdaType
cuda: bool
gpu_function: LambdaType
gpu_loop: LambdaType
ini_function: LambdaType
loop(func, iterator, out, array, *args, **kwargs)[source]
property ndimage
ndims: int
out_function: LambdaType
par_function: LambdaType
par_loop: LambdaType
parallel: bool
parallel_loop(func, out, array, *args, **kwargs)[source]
remove_cuda: bool
remove_parallel: bool
property scipyx
shape(array)[source]
stacks: bool
use_joblib: bool
property xp

Image

Signal

Volume