Skip to content

Commit 39f7b1f

Browse files
Fix review comments
1 parent aa27725 commit 39f7b1f

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

dpnp/backend/extensions/sycl_ext/histogram.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@
3131
#include <unordered_map>
3232
#include <vector>
3333

34-
// dpctl tensor headers
35-
#include "utils/type_dispatch.hpp"
3634
#include <pybind11/pybind11.h>
3735
#include <pybind11/stl.h>
3836

37+
// dpctl tensor headers
38+
#include "dpctl4pybind11.hpp"
39+
#include "utils/type_dispatch.hpp"
40+
3941
#include "histogram.hpp"
4042
#include "histogram_common.hpp"
4143

dpnp/dpnp_iface_histograms.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,12 @@ def histogram(a, bins=10, range=None, density=None, weights=None):
477477
"supported types"
478478
)
479479

480-
a_casted = a.astype(a_bin_dtype, order="C", copy=False)
481-
bin_edges_casted = bin_edges.astype(a_bin_dtype, order="C", copy=False)
480+
a_casted = dpnp.astype(a, a_bin_dtype, order="C", copy=False)
481+
bin_edges_casted = dpnp.astype(
482+
bin_edges, a_bin_dtype, order="C", copy=False
483+
)
482484
weights_casted = (
483-
weights.astype(hist_dtype, order="C", copy=False)
485+
dpnp.astype(weights, hist_dtype, order="C", copy=False)
484486
if weights is not None
485487
else None
486488
)
@@ -516,7 +518,7 @@ def histogram(a, bins=10, range=None, density=None, weights=None):
516518
if usm_type != n_usm_type:
517519
n = dpnp.asarray(n_casted, dtype=ntype, usm_type=usm_type)
518520
else:
519-
n = n_casted.astype(ntype, copy=False)
521+
n = dpnp.astype(n_casted, ntype, copy=False)
520522

521523
if density:
522524
# pylint: disable=possibly-used-before-assignment

0 commit comments

Comments
 (0)