Description
I think (correct me if I am mistaken) that currently the only way to convert an array object back to a Python representation is to call float
, int
, bool
, etc on 0D arrays. This requires that the user knows the appropriate function to call and does not offer any standard way to retrieve the underlying Python object when the library has additional dtypes, such as object
in NumPy.
Moreover, as there is no tolist
in the standard, it is also not possible to obtain a list representation of the array (from which the Python object could be retrieved).
I propose to add tolist
to the standard, as defined in NumPy and Pytorch to deal with these cases. Although the name is a bit misleading (because for 0D arrays there is no list at all), I think that prior art justifies reusing that name.