data-apis/array-api-strict

BUG: `full_like` accepts array `fill_value`

lucascolley opened this issue · 3 comments

In [1]: import array_api_strict as xp

In [2]: xp.full_like(xp.asarray(0), xp.asarray(1))
Out[2]: Array(1, dtype=array_api_strict.int64)

Spec:

fill_value (Union[bool, int, float, complex]) – fill value.

This seems like it should be fixed in the standard. Getting a fill value from an array seems like it wouldn't be uncommon.

Torch only accepts a scalar in full and full_like. To update the standard, I'd want to see upstream support added first.

Dask also throws a FutureWarning since its implementation uses np.copyto, which it says may stop working with dask arrays in the future.