Skip to content

Commit e6c66d1

Browse files
Fix review comments
1 parent 088beb5 commit e6c66d1

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-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: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,11 @@ 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)
482483
weights_casted = (
483-
weights.astype(hist_dtype, order="C", copy=False)
484+
dpnp.astype(weights, hist_dtype, order="C", copy=False)
484485
if weights is not None
485486
else None
486487
)
@@ -516,7 +517,7 @@ def histogram(a, bins=10, range=None, density=None, weights=None):
516517
if usm_type != n_usm_type:
517518
n = dpnp.asarray(n_casted, dtype=ntype, usm_type=usm_type)
518519
else:
519-
n = n_casted.astype(ntype, copy=False)
520+
n = dpnp.astype(n_casted, ntype, copy=False)
520521

521522
if density:
522523
# pylint: disable=possibly-used-before-assignment

0 commit comments

Comments
 (0)