`cupy` `repeat` does not accept CuPy array for `repeats`
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by running the reported Python example for xp.repeat(x, x) with CuPy and compare it with array_api_strict. Read the Array API repeat specification and CuPy issue #3849 to determine whether the compatibility layer should handle array-valued repeats or document the limitation; done means reaching a clear decision and adding coverage if a change is warranted.
Written by the indexing model from the issue text.
Description
The standard specifies that the second argument of repeat ("repeats") can be an array of integers, but CuPy doesn't support this.
from array_api_compat import cupy as xp # not OK
# import array_api_strict as xp # OK
x = xp.asarray([1, 2, 3])
xp.repeat(x, x)
# ValueError: cupy.ndaray cannot be specified as `repeats` argument.
The array API documentation of repeats notes:
For specification-conforming array libraries supporting hardware acceleration, providing an array for
repeatsmay cause device synchronization due to an unknown output shape. For those array libraries where synchronization concerns are applicable, conforming array libraries are advised to include a warning in their documentation regarding potential performance degradation whenrepeatsis an array.
From https://github.com/cupy/cupy/issues/3849, I see that this is the case for CuPy. Not sure what that means for this issue. One could argue that CuPy does not support it and that this can be closed.
- Dominant language
- Python
- Stars
- 131
- Forks
- 49
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 6
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from data-apis/array-api-compat
-
blocked by upstream
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
data-apis/array-api-compat#439 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
data-apis/array-api-compat#395 · 2 comments ·
-
Release 1.16Open
Difficulty 5/5 Over a week Newbie friendliness 25/100
data-apis/array-api-compat#476 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
data-apis/array-api-compat#473 · 4 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
data-apis/array-api-compat#465 · 3 comments ·
All issues in data-apis/array-api-compat
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
gradio-app/gradio#13895 ·
Maintainers usually reply within 1 day
-
build-error
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
spack/spack-packages#6713 ·
Maintainers usually reply within 1 day
-
Use issue templatesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ActivityWatch/activitywatch#1464 · 1 reaction ·
Maintainers usually reply within 1 day
-
[Bug]: The ckg tool drops the return type of every decorated Python method in class search resultsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bytedance/trae-agent#483 ·
Maintainers usually reply within 1 day