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

Explicit shape comparison for dpnp and numpy outputs #2295

Open
wants to merge 1 commit 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.17.0dev6=py312he4f9c94_22 ran successfully.
Passed: 1004
Failed: 0
Skipped: 10

@coveralls
Copy link
Collaborator

coveralls commented Feb 4, 2025

Coverage Status

coverage: 71.763%. remained the same
when pulling 135df75 on compare-shape
into f56a43f 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
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