8000 Update review comments on the array API document · asmeurer/numpy@be1f91c · GitHub
[go: up one dir, main page]

Skip to content

Commit be1f91c

Browse files
committed
Update review comments on the array API document
1 parent 9bd3b6e commit be1f91c

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

doc/source/reference/array_api.rst

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ independently of values or shapes.
233233
* - ``__pow__`` and ``__rpow__`` do not do value-based casting for 0-D
234234
arrays.
235235
- **Breaking**
236-
- For example, ``np.array(0., dtype=float32)*np.array(0.,
236+
- For example, ``np.array(0., dtype=float32)**np.array(0.,
237237
dtype=float64)`` is ``float32``. Note that this is value-based casting
238238
on 0-D arrays, not scalars.
239239
* - No cross-kind casting.
@@ -534,11 +534,13 @@ Array Object Differences
534534
- Type
535535
- Notes
536536
* - No array scalars
537-
- ???
538-
- The spec does not have array scalars, only 0-D arrays. It is not clear
539-
if NumPy's scalars deviate from the spec 0-D array behavior in any ways
540-
other than the ones outlined in
541-
:ref:`array_api-type-promotion-differences`.
537+
- **Strictness**
538+
- The spec does not have array scalars, only 0-D arrays. However, other
539+
than the promotion differ FF35 ences outlined in
540+
:ref:`array_api-type-promotion-differences`, scalars duck type as 0-D
541+
arrays for the purposes of the spec. The are immutable, but the spec
542+
`does not require mutability
543+
<https://data-apis.org/array-api/latest/design_topics/copies_views_and_mutation.html>`__.
542544
* - ``bool()``, ``int()``, and ``float()`` only work on 0-D arrays.
543545
- **Strictness**
544546
- See https://github.com/numpy/numpy/issues/10404.
@@ -627,7 +629,8 @@ Linear Algebra Differences
627629
-
628630
* - ``diagonal`` operates on the last two axes.
629631
- **Breaking**
630-
-
632+
- Strictly speaking this can be **compatible** because ``diagonal`` is
633+
moved to the ``linalg`` namespace.
631634
* - ``eigh``, ``qr``, ``slogdet`` and ``svd`` return a named tuple.
632635
- **Compatible**
633636
- The corresponding ``numpy`` functions return a ``tuple``, with the
@@ -637,7 +640,7 @@ Linear Algebra Differences
637640
- The ``norm`` function has been omitted from the array API and split
638641
into ``matrix_norm`` for matrix norms and ``vector_norm`` for vector
639642
norms. Note that ``vector_norm`` supports any number of axes, whereas
640-
``np.norm`` only supports a single axis for vector norms.
643+
``np.linalg.norm`` only supports a single axis for vector norms.
641644
* - ``matrix_rank`` has an ``rtol`` keyword argument instead of ``tol``.
642645
- **Compatible**
643646
- In the array API, ``rtol`` filters singular values smaller than
@@ -698,7 +701,7 @@ Manipulation Functions Differences
698701
- No cross-kind casting. No value-based casting on scalars.
699702
* - ``stack`` has different default casting rules from ``np.stack``
700703
- **Strictness**
701-
- No cross-kind casting. No value-based casting on scalars.
704+
- No cross-kind casting.
702705
* - New function ``permute_dims``.
703706
- **Compatible**
704707
- Unlike ``np.transpose``, the ``axis`` keyword argument to

0 commit comments

Comments
 (0)
0