You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- If ``N`` is ``0``, the sum is ``0`` (i.e., the empty sum).
176
176
177
-
For floating-point operands,
178
-
179
-
- If ``x_i`` is ``NaN``, the sum is ``NaN`` (i.e., ``NaN`` values propagate).
177
+
For both real-valued and complex floating-point operands, special cases must be handled as if the operation is implemented by successive application of :func:`~array_api.add`.
180
178
181
179
Parameters
182
180
----------
183
181
x: array
184
-
input array. Should have a real-valued data type.
182
+
input array. Should have a numeric data type.
185
183
axis: Optional[Union[int, Tuple[int, ...]]]
186
184
axis or axes along which sums must be computed. By default, the sum must be computed over the entire array. If a tuple of integers, sums must be computed over multiple axes. Default: ``None``.
187
185
dtype: Optional[dtype]
188
186
data type of the returned array. If ``None``,
189
187
190
-
- if the default data type corresponding to the data type "kind" (integer or 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``.
188
+
- 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``.
191
189
- if ``x`` has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
190
+
- if ``x`` has a complex floating-point data type, the returned array must have the default complex floating-point data type.
192
191
- if ``x`` has a signed integer data type (e.g., ``int16``), the returned array must have the default integer data type.
193
192
- 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).
0 commit comments