You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support of uint64 dtype in dpnp.bincount (#2361)
Previously NumPy prohibits `uint64` dtype of input array in
`numpy.bincount`. But that is going to be changed since `2.2.4` release
(fixed in numpy#28355 and backported to 2.2.x branch in numpy#28420).
This PR proposes to align with upcoming changes and to allow `uint64`
dtype of input array in `dpnp.bincount`.
Additionally, it extends the docstring of histogram-like functions to
clearly notify with a warning about possible synchronization impact. acd33e4
@@ -400,6 +400,11 @@ <h1>Source code for dpnp.dpnp_iface_histograms</h1><div class="highlight"><pre>
400
400
401
401
<spanclass="sd"> For full documentation refer to :obj:`numpy.bincount`.</span>
402
402
403
+
<spanclass="sd"> Warning</span>
404
+
<spanclass="sd"> -------</span>
405
+
<spanclass="sd"> This function synchronizes in order to calculate binning edges.</span>
406
+
<spanclass="sd"> This may harm performance in some applications.</span>
407
+
403
408
<spanclass="sd"> Parameters</span>
404
409
<spanclass="sd"> ----------</span>
405
410
<spanclass="sd"> x : {dpnp.ndarray, usm_ndarray}</span>
@@ -478,10 +483,8 @@ <h1>Source code for dpnp.dpnp_iface_histograms</h1><div class="highlight"><pre>
478
483
479
484
<spanclass="k">if</span><spanclass="n">x_casted_dtype</span><spanclass="ow">is</span><spanclass="kc">None</span><spanclass="ow">or</span><spanclass="n">ntype_casted</span><spanclass="ow">is</span><spanclass="kc">None</span><spanclass="p">:</span><spanclass="c1"># pragma: no cover</span>
<spanclass="sa">f</span><spanclass="s2">"function '</span><spanclass="si">{</span><spanclass="n">bincount</span><spanclass="si">}</span><spanclass="s2">' does not support input types "</span>
<spanclass="sa">f</span><spanclass="s2">"Input types (</span><spanclass="si">{</span><spanclass="n">x</span><spanclass="o">.</span><spanclass="n">dtype</span><spanclass="si">}</span><spanclass="s2">, </span><spanclass="si">{</span><spanclass="n">ntype</span><spanclass="si">}</span><spanclass="s2">) are not supported, "</span>
487
+
<spanclass="s2">"and the inputs could not be coerced to any supported types"</span>
@@ -601,6 +604,11 @@ <h1>Source code for dpnp.dpnp_iface_histograms</h1><div class="highlight"><pre>
601
604
602
605
<spanclass="sd"> For full documentation refer to :obj:`numpy.histogram`.</span>
603
606
607
+
<spanclass="sd"> Warning</span>
608
+
<spanclass="sd"> -------</span>
609
+
<spanclass="sd"> This function may synchronize in order to check a monotonically increasing</span>
610
+
<spanclass="sd"> array of bin edges. This may harm performance in some applications.</span>
611
+
604
612
<spanclass="sd"> Parameters</span>
605
613
<spanclass="sd"> ----------</span>
606
614
<spanclass="sd"> a : {dpnp.ndarray, usm_ndarray}</span>
@@ -704,9 +712,8 @@ <h1>Source code for dpnp.dpnp_iface_histograms</h1><div class="highlight"><pre>
704
712
705
713
<spanclass="k">if</span><spanclass="n">a_bin_dtype</span><spanclass="ow">is</span><spanclass="kc">None</span><spanclass="ow">or</span><spanclass="n">hist_dtype</span><spanclass="ow">is</span><spanclass="kc">None</span><spanclass="p">:</span><spanclass="c1"># pragma: no cover</span>
<spanclass="sa">f</span><spanclass="s2">"function '</span><spanclass="si">{</span><spanclass="n">histogram</span><spanclass="si">}</span><spanclass="s2">' does not support input types "</span>
0 commit comments