Skip to content

(Re)implement ndonnx.repeat for all built-in data types#161

Merged
Christian Bourjau (cbourjau) merged 2 commits intomainfrom
reimplement-repeat
Aug 13, 2025
Merged

(Re)implement ndonnx.repeat for all built-in data types#161
Christian Bourjau (cbourjau) merged 2 commits intomainfrom
reimplement-repeat

Conversation

@cbourjau
Copy link
Copy Markdown
Collaborator

@cbourjau Christian Bourjau (cbourjau) commented Aug 12, 2025

This PR implements repeat for all built-in data types. This is possible since the implementation only relies on other high-level APIs instead of the underlying layout. We used to have an implementation for ndonnx.repeat before, but it got lost during the refactoring leading up to 0.10.0. The previous implementation used searchsorted while this one uses broadcasting and reshaping. Either has compromises. The earlier one was likely heavier on the CPU, while this one may be more memory hungry in some circumstances. My gut feeling is that this implementation is the better compromise.

The change to the array-api-tests is due to this upstream issue: data-apis/array-api-tests#388

Justin Chu (@justinchuby)

Comment thread ndonnx/_typed_array/onnx.py
Comment thread ndonnx/_typed_array/typed_array.py
@cbourjau Christian Bourjau (cbourjau) merged commit 1701ed7 into main Aug 13, 2025
39 checks passed
@cbourjau Christian Bourjau (cbourjau) deleted the reimplement-repeat branch August 13, 2025 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants