Skip to content

Conversation

@antonwolfy
Copy link
Contributor

@antonwolfy antonwolfy commented Feb 3, 2026

The PR extends implementation of dpnp.nan_to_num function to align with NumPy and CuPy which supports nan, posinf, and neginf keywords as any array through broadcasting.

This PR adds handling for a common path where at least one of the keywords has non-scalar value.
The path does not assume a dedicated SYCL kernel, instead proposes to rely on implementation through existing python functions. That can be improved in the future if required.

  • 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?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

@antonwolfy antonwolfy added this to the 0.20.0 release milestone Feb 3, 2026
@antonwolfy antonwolfy self-assigned this Feb 3, 2026
@antonwolfy antonwolfy changed the title Extend nan_to_num implementation with broadcast support of nan, posinf, and neginf Extend nan_to_num with broadcast support of nan, posinf, and neginf Feb 3, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

Array API standard conformance tests for dpnp=0.20.0dev2=py313h509198e_17 ran successfully.
Passed: 1352
Failed: 3
Skipped: 9

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

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

@coveralls
Copy link
Collaborator

coveralls commented Feb 3, 2026

Coverage Status

coverage: 81.115% (+0.01%) from 81.103%
when pulling 1077877 on nan-to-num-broadcasting
into 1f7f4d9 on master.

@antonwolfy antonwolfy marked this pull request as ready for review February 3, 2026 19:02
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