• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IntelPython / dpnp / 37211143718
79%

Build:
DEFAULT BRANCH: master
Ran 04 Oct 2026 04:23PM UTC
Jobs 1
Files 263
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Oct 2026 02:56PM UTC coverage: 78.621% (-0.001%) from 78.622%
37211143718

push

github

web-flow
Fix `dpnp.median`/`dpnp.nanmedian` result shape for empty and size-1 kept dimensions (#3081)

This PR fixes two kept-dimension shape bugs in
`dpnp.median`/`dpnp.nanmedian`.

**Empty kept dimension.** `dpnp.median` and `dpnp.nanmedian` raised
`ValueError` when called with a tuple (or list) `axis` and one of the
kept, non-reduced dimensions has size 0, e.g.
```
dpnp.median(dpnp.empty((0, 3, 4)), axis=(1, 2))
```
The sequence-axis path flattens the reduced axes in
`_flatten_array_along_axes` with `a.reshape(kept_shape + (-1,))`. The
`-1` cannot be inferred once the array has size 0 and a kept axis is
also 0 (every merged length yields a size-0 array, so the dimension is
ambiguous), which makes `reshape` raise. The merged length is now
computed explicitly with `math.prod(...)`, so the tuple-axis path
returns the same empty result as the single-axis path.

**Size-1 kept dimension.** `dpnp.nanmedian` dropped kept dimensions of
size 1 and returned the wrong shape, e.g. a `(1, 5)` array reduced over
`axis=1` returned shape `()` instead of `(1,)`. `_calc_nanmedian` ended
with an unconditional `dpnp.squeeze(res)`, which also removed
non-reduced size-1 axes; it now squeezes only the reduced trailing axis
with `dpnp.squeeze(res, axis=-1)`.

1566 of 2924 branches covered (53.56%)

Branch coverage included in aggregate %.

4 of 4 new or added lines in 1 file covered. (100.0%)

1 existing line in 1 file now uncovered.

26846 of 33214 relevant lines covered (80.83%)

8600.85 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
86.29
-0.27% dpnp/tensor/_elementwise_common.py
Jobs
ID Job ID Ran Files Coverage
1 37211143718.1 04 Oct 2026 04:23PM UTC 263
78.62
GitHub Action Run
Source Files on build 37211143718
  • Tree
  • List 263
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #37211143718
  • eec0aeb1 on github
  • Prev Build on master (#37066880482)
  • Next Build on master (#37218805121)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc