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
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
-
140
139
.. note::
141
140
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
235
230
236
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))``.
237
+
238
+
.. versionchanged:: 2022.12
239
+
Added boolean and complex data type support.
231
240
"""
232
241
233
242
def__complex__(self: array, /) ->complex:
@@ -326,6 +335,8 @@ def __dlpack__(
326
335
errors are raised when export fails for other reasons (e.g., incorrect
Copy file name to clipboardExpand all lines: src/array_api_stubs/_draft/creation_functions.py
+24Lines changed: 24 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -97,6 +97,9 @@ def asarray(
97
97
-------
98
98
out: array
99
99
an array containing the data from ``obj``.
100
+
101
+
.. versionchanged:: 2022.12
102
+
Added complex data type support.
100
103
"""
101
104
102
105
@@ -179,6 +182,9 @@ def eye(
179
182
-------
180
183
out: array
181
184
an array where all elements are equal to zero, except for the ``k``\th diagonal, whose values are equal to one.
185
+
186
+
.. versionchanged:: 2022.12
187
+
Added complex data type support.
182
188
"""
183
189
184
190
@@ -237,6 +243,9 @@ def full(
237
243
-------
238
244
out: array
239
245
an array where every element is equal to ``fill_value``.
246
+
247
+
.. versionchanged:: 2022.12
248
+
Added complex data type support.
240
249
"""
241
250
242
251
@@ -273,6 +282,9 @@ def full_like(
273
282
-------
274
283
out: array
275
284
an array having the same shape as ``x`` and where every element is equal to ``fill_value``.
285
+
286
+
.. versionchanged:: 2022.12
287
+
Added complex data type support.
276
288
"""
277
289
278
290
@@ -340,6 +352,9 @@ def linspace(
340
352
341
353
.. note::
342
354
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
383
369
384
Each returned array should have the same data type as the input arrays.
385
+
386
+
.. versionchanged:: 2022.12
387
+
Added complex data type support.
370
388
"""
371
389
372
390
@@ -395,6 +413,9 @@ def ones(
395
413
-------
396
414
out: array
397
415
an array containing ones.
416
+
417
+
.. versionchanged:: 2022.12
418
+
Added complex data type support.
398
419
"""
399
420
400
421
@@ -420,6 +441,9 @@ def ones_like(
420
441
-------
421
442
out: array
422
443
an array having the same shape as ``x`` and filled with ones.
0 commit comments