Skip to content

Commit 39dd9ac

Browse files
authored
Merge pull request #666 from steff456/fix-desc
PR-URL: #666 Reviewed-by: Athan Reines <kgryte@gmail.com>
2 parents b823223 + 1d99f90 commit 39dd9ac

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

src/array_api_stubs/_draft/linalg.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -745,10 +745,11 @@ def trace(x: array, /, *, offset: int = 0, dtype: Optional[dtype] = None) -> arr
745745
data type of the returned array. If ``None``,
746746
747747
- if the default data type corresponding to the data type "kind" (integer, real-valued floating-point, or complex floating-point) of ``x`` has a smaller range of values than the data type of ``x`` (e.g., ``x`` has data type ``int64`` and the default data type is ``int32``, or ``x`` has data type ``uint64`` and the default data type is ``int64``), the returned array must have the same data type as ``x``.
748-
- if ``x`` has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
749-
- if ``x`` has a complex floating-point data type, the returned array must have the default complex floating-point data type.
750-
- if ``x`` has a signed integer data type (e.g., ``int16``), the returned array must have the default integer data type.
751-
- if ``x`` has an unsigned integer data type (e.g., ``uint16``), the returned array must have an unsigned integer data type having the same number of bits as the default integer data type (e.g., if the default integer data type is ``int32``, the returned array must have a ``uint32`` data type).
748+
- if the default data type corresponding to the data type "kind" of ``x`` has the same or a larger range of values than the data type of ``x``,
749+
- if ``x`` has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
750+
- if ``x`` has a complex floating-point data type, the returned array must have the default complex floating-point data type.
751+
- if ``x`` has a signed integer data type (e.g., ``int16``), the returned array must have the default integer data type.
752+
- if ``x`` has an unsigned integer data type (e.g., ``uint16``), the returned array must have an unsigned integer data type having the same number of bits as the default integer data type (e.g., if the default integer data type is ``int32``, the returned array must have a ``uint32`` data type).
752753
753754
If the data type (either specified or resolved) differs from the data type of ``x``, the input array should be cast to the specified data type before computing the sum. Default: ``None``.
754755

src/array_api_stubs/_draft/statistical_functions.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,11 @@ def prod(
146146
data type of the returned array. If ``None``,
147147
148148
- if the default data type corresponding to the data type "kind" (integer, real-valued floating-point, or complex floating-point) of ``x`` has a smaller range of values than the data type of ``x`` (e.g., ``x`` has data type ``int64`` and the default data type is ``int32``, or ``x`` has data type ``uint64`` and the default data type is ``int64``), the returned array must have the same data type as ``x``.
149-
- if ``x`` has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
150-
- if ``x`` has a complex floating-point data type, the returned array must have the default complex floating-point data type.
151-
- if ``x`` has a signed integer data type (e.g., ``int16``), the returned array must have the default integer data type.
152-
- if ``x`` has an unsigned integer data type (e.g., ``uint16``), the returned array must have an unsigned integer data type having the same number of bits as the default integer data type (e.g., if the default integer data type is ``int32``, the returned array must have a ``uint32`` data type).
149+
- if the default data type corresponding to the data type "kind" of ``x`` has the same or a larger range of values than the data type of ``x``,
150+
- if ``x`` has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
151+
- if ``x`` has a complex floating-point data type, the returned array must have the default complex floating-point data type.
152+
- if ``x`` has a signed integer data type (e.g., ``int16``), the returned array must have the default integer data type.
153+
- if ``x`` has an unsigned integer data type (e.g., ``uint16``), the returned array must have an unsigned integer data type having the same number of bits as the default integer data type (e.g., if the default integer data type is ``int32``, the returned array must have a ``uint32`` data type).
153154
154155
If the data type (either specified or resolved) differs from the data type of ``x``, the input array should be cast to the specified data type before computing the product. Default: ``None``.
155156
@@ -243,10 +244,11 @@ def sum(
243244
data type of the returned array. If ``None``,
244245
245246
- if the default data type corresponding to the data type "kind" (integer, real-valued floating-point, or complex floating-point) of ``x`` has a smaller range of values than the data type of ``x`` (e.g., ``x`` has data type ``int64`` and the default data type is ``int32``, or ``x`` has data type ``uint64`` and the default data type is ``int64``), the returned array must have the same data type as ``x``.
246-
- if ``x`` has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
247-
- if ``x`` has a complex floating-point data type, the returned array must have the default complex floating-point data type.
248-
- if ``x`` has a signed integer data type (e.g., ``int16``), the returned array must have the default integer data type.
249-
- if ``x`` has an unsigned integer data type (e.g., ``uint16``), the returned array must have an unsigned integer data type having the same number of bits as the default integer data type (e.g., if the default integer data type is ``int32``, the returned array must have a ``uint32`` data type).
247+
- if the default data type corresponding to the data type "kind" of ``x`` has the same or a larger range of values than the data type of ``x``,
248+
- if ``x`` has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
249+
- if ``x`` has a complex floating-point data type, the returned array must have the default complex floating-point data type.
250+
- if ``x`` has a signed integer data type (e.g., ``int16``), the returned array must have the default integer data type.
251+
- if ``x`` has an unsigned integer data type (e.g., ``uint16``), the returned array must have an unsigned integer data type having the same number of bits as the default integer data type (e.g., if the default integer data type is ``int32``, the returned array must have a ``uint32`` data type).
250252
251253
If the data type (either specified or resolved) differs from the data type of ``x``, the input array should be cast to the specified data type before computing the sum. Default: ``None``.
252254

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy