Skip to content

Commit 3267c18

Browse files
ev-brkgrytelucascolley
authored
docs: clarify that behavior when provided a nested sequence to asarray is unspecified
PR-URL: #917 Ref: data-apis/array-api-strict#118 Co-authored-by: Athan Reines <[email protected]> Reviewed-by: Athan Reines <[email protected]> Co-authored-by: Lucas Colley <[email protected]> Reviewed-by: Lucas Colley <[email protected]>
1 parent e906ba8 commit 3267c18

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/array_api_stubs/_draft/creation_functions.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,6 @@ def asarray(
101101
102102
Default: ``None``.
103103
104-
.. admonition:: Note
105-
:class: note
106-
107-
If ``dtype`` is not ``None``, then array conversions should obey :ref:`type-promotion` rules. Conversions not specified according to :ref:`type-promotion` rules may or may not be permitted by a conforming array library. To perform an explicit cast, use :func:`array_api.astype`.
108-
109-
.. note::
110-
If an input value exceeds the precision of the resolved output array data type, behavior is left unspecified and, thus, implementation-defined.
111-
112104
device: Optional[device]
113105
device on which to place the created array. If ``device`` is ``None`` and ``obj`` is an array, the output array device must be inferred from ``obj``. Default: ``None``.
114106
copy: Optional[bool]
@@ -122,6 +114,10 @@ def asarray(
122114
Notes
123115
-----
124116
117+
- If ``obj`` is a sequence with some elements being arrays, behavior is unspecified and thus implementation-defined. Conforming implementations may perform a conversion or raise an exception. To join a sequence of arrays along a new axis, see :func:`~array_api.stack`.
118+
- If ``dtype`` is not ``None``, then array conversions should obey :ref:`type-promotion` rules. Conversions not specified according to :ref:`type-promotion` rules may or may not be permitted by a conforming array library. To perform an explicit cast, use :func:`array_api.astype`.
119+
- If an input value exceeds the precision of the resolved output array data type, behavior is unspecified and thus implementation-defined.
120+
125121
.. versionchanged:: 2022.12
126122
Added complex data type support.
127123
"""

0 commit comments

Comments
 (0)