Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for tiling an array to the specification #692

Merged
merged 6 commits into from
Oct 19, 2023

Conversation

kgryte
Copy link
Contributor

@kgryte kgryte commented Sep 21, 2023

This PR

  • resolves RFC: add support for creating a new array by tiling a provided array #655 by adding an API for creating a new array by tiling an input array a specified number of repetitions.
  • requires that the second positional argument (repetitions) be a tuple of ints. NumPy et al support providing an integer; however, PyTorch and TensorFlow do not. PyTorch requires a tuple. TensorFlow requires an array. This PR seeks to find common ground by requiring repetitions to be a tuple.
  • supports prepend behavior, as supported by NumPy et al and PyTorch. I.e., if len(repetitions) is less than the rank of x, then ones are prepended to repetitions. If the rank of x is less than len(repetitions), singleton dimensions are prepended to x. TensorFlow does not support this behavior, requiring that repetitions.shape[0] equal the rank of x.

@kgryte kgryte added API extension Adds new functions or objects to the API. topic: Manipulation Array manipulation and transformation. labels Sep 21, 2023
@kgryte kgryte added this to the v2023 milestone Sep 21, 2023
@kgryte
Copy link
Contributor Author

kgryte commented Oct 19, 2023

As this PR has been discussed during Consortium meetings and no objections have been raised either here or in the original RFC (#655), will merge. Any further changes can be addressed in follow-up PRs...

@kgryte kgryte merged commit 2bcf7c0 into data-apis:main Oct 19, 2023
3 checks passed
@kgryte kgryte deleted the tile branch October 19, 2023 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API extension Adds new functions or objects to the API. topic: Manipulation Array manipulation and transformation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFC: add support for creating a new array by tiling a provided array
2 participants