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
Add admonitions for new and changed APIs in 2022 version (#585)
- Add version changed to functions that were modified for complex support in 2022
- Add version added to functions created in 2022
Co-authored-by: Ralf Gommers <[email protected]>
an array containing the element-wise absolute value. If ``self`` has a real-valued data type, the returned array must have the same data type as ``self``. If ``self`` has a complex floating-point data type, the returned arrayed must have a real-valued floating-point data type whose precision matches the precision of ``self`` (e.g., if ``self`` is ``complex128``, then the returned array must have a ``float64`` data type).
138
138
139
+
Notes
140
+
-----
139
141
140
142
.. note::
141
143
Element-wise results, including special cases, must equal the results returned by the equivalent element-wise function :func:`~array_api.abs`.
- If ``self`` is either ``+0`` or ``-0``, the result is ``False``.
229
239
230
240
For complex floating-point operands, special cases must be handled as if the operation is implemented as the logical AND of ``bool(real(self))`` and ``bool(imag(self))``.
- if either ``self`` or ``other`` has more than two dimensions, an array having a shape determined by :ref:`broadcasting` ``shape(self)[:-2]`` against ``shape(other)[:-2]`` and containing the `conventional matrix product <https://en.wikipedia.org/wiki/Matrix_multiplication>`_ for each stacked matrix.
672
698
- The returned array must have a data type determined by :ref:`type-promotion`.
673
699
700
+
Notes
701
+
-----
674
702
675
703
.. note::
676
704
Results must equal the results returned by the equivalent function :func:`~array_api.matmul`.
Copy file name to clipboardExpand all lines: src/array_api_stubs/_draft/creation_functions.py
+47
Original file line number
Diff line number
Diff line change
@@ -97,6 +97,12 @@ def asarray(
97
97
-------
98
98
out: array
99
99
an array containing the data from ``obj``.
100
+
101
+
Notes
102
+
-----
103
+
104
+
.. versionchanged:: 2022.12
105
+
Added complex data type support.
100
106
"""
101
107
102
108
@@ -179,6 +185,12 @@ def eye(
179
185
-------
180
186
out: array
181
187
an array where all elements are equal to zero, except for the ``k``\th diagonal, whose values are equal to one.
188
+
189
+
Notes
190
+
-----
191
+
192
+
.. versionchanged:: 2022.12
193
+
Added complex data type support.
182
194
"""
183
195
184
196
@@ -237,6 +249,12 @@ def full(
237
249
-------
238
250
out: array
239
251
an array where every element is equal to ``fill_value``.
252
+
253
+
Notes
254
+
-----
255
+
256
+
.. versionchanged:: 2022.12
257
+
Added complex data type support.
240
258
"""
241
259
242
260
@@ -273,6 +291,12 @@ def full_like(
273
291
-------
274
292
out: array
275
293
an array having the same shape as ``x`` and where every element is equal to ``fill_value``.
294
+
295
+
Notes
296
+
-----
297
+
298
+
.. versionchanged:: 2022.12
299
+
Added complex data type support.
276
300
"""
277
301
278
302
@@ -334,12 +358,17 @@ def linspace(
334
358
out: array
335
359
a one-dimensional array containing evenly spaced values.
336
360
361
+
Notes
362
+
-----
337
363
338
364
.. note::
339
365
While this specification recommends that this function only return arrays having a floating-point data type, specification-compliant array libraries may choose to support output arrays having an integer data type (e.g., due to backward compatibility concerns). However, function behavior when generating integer output arrays is unspecified and, thus, is implementation-defined. Accordingly, using this function to generate integer output arrays is not portable.
340
366
341
367
.. note::
342
368
As mixed data type promotion is implementation-defined, behavior when ``start`` or ``stop`` exceeds the maximum safe integer of an output floating-point data type is implementation-defined. An implementation may choose to overflow or raise an exception.
Similarly, for the three-dimensional case with input one-dimensional arrays of length ``M``, ``N``, and ``P``, if matrix indexing ``ij``, then each returned array must have shape ``(M, N, P)``, and, if Cartesian indexing ``xy``, then each returned array must have shape ``(N, M, P)``.
368
397
369
398
Each returned array should have the same data type as the input arrays.
399
+
400
+
Notes
401
+
-----
402
+
403
+
.. versionchanged:: 2022.12
404
+
Added complex data type support.
370
405
"""
371
406
372
407
@@ -395,6 +430,12 @@ def ones(
395
430
-------
396
431
out: array
397
432
an array containing ones.
433
+
434
+
Notes
435
+
-----
436
+
437
+
.. versionchanged:: 2022.12
438
+
Added complex data type support.
398
439
"""
399
440
400
441
@@ -420,6 +461,12 @@ def ones_like(
420
461
-------
421
462
out: array
422
463
an array having the same shape as ``x`` and filled with ones.
0 commit comments