The spec requires `asarray` to support "a (possibly nested) sequence of Python scalars", but not nested sequences of arrays. https://data-apis.org/array-api/draft/API_specification/generated/array_api.asarray.html
Activity
ev-br commentedon Mar 28, 2025
This just came up in #70 (comment), motivated by scikit-learn adoption work.
AFAICS, it is indeed unspecified in the spec and inconsistent across array libraries. Thus:
asarrayis unspecified array-api#917 suggest to make it explicit in the specarray-api-strictis welcome; will need to check the fallout at least in scipy.docs: clarify that behavior when provided a nested sequence to `asarr…