Skip to content

Correction to dpctl.tensor.tile for scalar input and empty repetitions#1628

Merged
ndgrigorian merged 1 commit intomasterfrom
fix-tile-copy-scalar
Apr 1, 2024
Merged

Correction to dpctl.tensor.tile for scalar input and empty repetitions#1628
ndgrigorian merged 1 commit intomasterfrom
fix-tile-copy-scalar

Conversation

@ndgrigorian
Copy link
Copy Markdown
Collaborator

This PR fixes a bug in tile where if the input is 0D and repetitions is empty, instead of a copying a scalar input and returning a scalar, a 1D array of size 1 would be returned instead.

Per the array API spec and Numpy, this is incorrect behavior.

Resolves #1627

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • If this PR is a work in progress, are you opening the PR as a draft?

… `repetitions`

 Previously, this case would return a 1D array of size 1, which did not match Numpy or the array API spec's expected behavior
Copy link
Copy Markdown
Contributor

@oleksandr-pavlyk oleksandr-pavlyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good to me! Thank you @ndgrigorian

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 1, 2024

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

@coveralls
Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 87.974% (+0.007%) from 87.967%
when pulling f873316 on fix-tile-copy-scalar
into 65bb9ef on master.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 1, 2024

Array API standard conformance tests for dpctl=0.17.0dev0=py310h15de555_161 ran successfully.
Passed: 839
Failed: 0
Skipped: 92

@ndgrigorian ndgrigorian merged commit 03c7615 into master Apr 1, 2024
@ndgrigorian ndgrigorian deleted the fix-tile-copy-scalar branch April 1, 2024 20:04
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.

tile does not handle empty repetitions and scalar input as per array API

3 participants