Skip to content

Commit cb7417e

Browse files
committed
Add note advising accelerator libraries to provide a warning in their documentation
1 parent 7b31dd8 commit cb7417e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/array_api_stubs/_draft/manipulation_functions.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ def repeat(
189189
- if ``repeats`` is an integer, ``repeats`` must be broadcasted to the shape ``(M,)``.
190190
191191
If ``repeats`` is an array, the array must have an integer data type.
192+
193+
194+
.. note::
195+
For specification-conforming array libraries supporting hardware acceleration, providing an array of ``repeats`` may cause device synchronization due to an unknown output shape. Conforming array libraries are advised to include a warning in their documentation regarding potential performance degradation when ``repeats`` is an array.
196+
192197
axis: Optional[int]
193198
the axis (dimension) along which to repeat elements. If ``axis`` is `None`, the function must repeat elements of the flattened input array ``x`` and return the result as a one-dimensional output array. A flattened input array must be flattened in row-major, C-style order. Default: ``None``.
194199

0 commit comments

Comments
 (0)