backend_name

function of dascore.utils.array_api source

backend_name(
    array: Any ,
)-> ‘str’

Return the name of the array backend which owns array.

The name is the top-level package of the array’s namespace, so numpy arrays return “numpy”, jax arrays “jax”, dask arrays “dask”, etc.

Parameters

Parameter Description
array Any array which implements the array API standard.

Examples

import numpy as np
from dascore.utils.array_api import backend_name

assert backend_name(np.array([1, 2])) == "numpy"