Skip to content

Align dpnp.tensor.expand_dims with Python array API 2025.12#2988

Merged
antonwolfy merged 8 commits into
masterfrom
align-tensor.expand_dims-with-array-api-2025.12
Jul 8, 2026
Merged

Align dpnp.tensor.expand_dims with Python array API 2025.12#2988
antonwolfy merged 8 commits into
masterfrom
align-tensor.expand_dims-with-array-api-2025.12

Conversation

@antonwolfy

@antonwolfy antonwolfy commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

This PR aligns dpnp.tensor.expand_dims with the Python array API specification (revision 2025.12), which defines the signature as expand_dims(x, /, axis)axis is a required positional-or-keyword argument with no default.

Previously the tensor-level function used expand_dims(X, /, *, axis=0) (axis keyword-only with a default of 0), which did not match the standard.
The public dpnp.expand_dims wrapper is also made positional-only for its array argument ((a, /, axis)), consistent with sibling array-API functions in the same module (squeeze, reshape, broadcast_to, stack).

The function body was already multi-axis capable; this change updates the signature and documentation to match, and closes gaps in test coverage.

  • 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.21.0 release milestone Jul 2, 2026
@antonwolfy antonwolfy self-assigned this Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

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

@coveralls

coveralls commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 78.11%. remained the same — align-tensor.expand_dims-with-array-api-2025.12 into master

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Array API standard conformance tests for dpnp=0.21.0dev2=py313h509198e_28 ran successfully.
Passed: 1373
Failed: 2
Skipped: 5

@antonwolfy antonwolfy merged commit edda84d into master Jul 8, 2026
119 of 127 checks passed
@antonwolfy antonwolfy deleted the align-tensor.expand_dims-with-array-api-2025.12 branch July 8, 2026 13:25
github-actions Bot added a commit that referenced this pull request Jul 8, 2026
This PR aligns `dpnp.tensor.expand_dims` with the Python array API
specification (revision 2025.12), which defines the signature as
`expand_dims(x, /, axis)` — `axis` is a **required**
positional-or-keyword argument with no default.

Previously the tensor-level function used `expand_dims(X, /, *, axis=0)`
(`axis` keyword-only with a default of `0`), which did not match the
standard.
The public `dpnp.expand_dims` wrapper is also made positional-only for
its array argument (`(a, /, axis)`), consistent with sibling array-API
functions in the same module (`squeeze`, `reshape`, `broadcast_to`,
`stack`).

The function body was already multi-axis capable; this change updates
the signature and documentation to match, and closes gaps in test
coverage. edda84d
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