{ } Raw JSON

bundles / scipy 1.17.1 / scipy / _lib / array_api_compat / common / _helpers / is_lazy_array

function

scipy._lib.array_api_compat.common._helpers:is_lazy_array

source: /scipy/_lib/array_api_compat/common/_helpers.py :996

Signature

def   is_lazy_array ( x : object )  →  TypeGuard[_ArrayApiObj]

Summary

Return True if x is potentially a future or it may be otherwise impossible or expensive to eagerly read its contents, regardless of their size, e.g. by calling bool(x) or float(x).

Extended Summary

Return False otherwise; e.g. bool(x) etc. is guaranteed to succeed and to be cheap as long as the array has the right dtype and size.

Notes

This function errs on the side of caution for array types that may or may not be lazy, e.g. JAX arrays, by always returning True for them.

Aliases

  • scipy.cluster.hierarchy.is_lazy_array