Closed
Description
In scikit-learn we use array values as dict keys, but trying this with array_api_strict
array dtypes fails:
import array_api_strict
labels= array_api_strict.asarray([4, 5, 6])
label_to_index = {entry: idx for idx, entry in enumerate(labels)}
TypeError: unhashable type: 'Array'
Since the dtypes are all numbers or boolean, they are immutable and - I was thinking - also hashable? For numpy and torch arrays they are.
Is this a bug or on purpose for some reason?
Metadata
Metadata
Assignees
Labels
No labels