Skip to content

Explicit shape comparison for dpnp and numpy outputs #2295

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vtavana
Copy link
Collaborator

@vtavana vtavana commented Feb 4, 2025

In the test suite, the result arrays from dpnp and numpy were compared, but their shapes were not explicitly checked for equality. As a result, tests could pass even if the shapes differed, such as one being (1,) and the other ().

This PR adds an explicit check to ensure that the output shapes of numpy and dpnp match. Additionally, tests have been updated accordingly to pass with this new check.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to 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 filing the PR as a draft?

@vtavana vtavana self-assigned this Feb 4, 2025
Copy link
Contributor

github-actions bot commented Feb 4, 2025

View rendered docs @ https://intelpython.github.io/dpnp/pull/2295/index.html

Copy link
Contributor

github-actions bot commented Feb 4, 2025

Array API standard conformance tests for dpnp=0.18.0dev1=py312he4f9c94_5 ran successfully.
Passed: 1221
Failed: 0
Skipped: 10

@coveralls
Copy link
Collaborator

coveralls commented Feb 4, 2025

Coverage Status

coverage: 72.271%. remained the same
when pulling fd343be on compare-shape
into 4c5970b on master.

@vtavana vtavana changed the title assert the shape of result and expected array are the same Explicit shape comparison for dpnp and numpy outputs Feb 4, 2025
@vtavana vtavana marked this pull request as ready for review February 4, 2025 20:46
@vtavana vtavana requested a review from ndgrigorian as a code owner February 20, 2025 00:56
@vtavana vtavana marked this pull request as draft April 11, 2025 18:41
@vtavana vtavana force-pushed the compare-shape branch 7 times, most recently from a47ee75 to 94c792e Compare April 12, 2025 20:10
@vtavana vtavana marked this pull request as ready for review April 14, 2025 05:36
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.

3 participants