diff --git a/dpnp/backend/extensions/sycl_ext/histogram.cpp b/dpnp/backend/extensions/sycl_ext/histogram.cpp index 4a71923e7cc..fc52d89cb3b 100644 --- a/dpnp/backend/extensions/sycl_ext/histogram.cpp +++ b/dpnp/backend/extensions/sycl_ext/histogram.cpp @@ -31,11 +31,13 @@ #include #include -// dpctl tensor headers -#include "utils/type_dispatch.hpp" #include #include +// dpctl tensor headers +#include "dpctl4pybind11.hpp" +#include "utils/type_dispatch.hpp" + #include "histogram.hpp" #include "histogram_common.hpp" diff --git a/dpnp/dpnp_iface_histograms.py b/dpnp/dpnp_iface_histograms.py index 824b097cb26..afe0924379b 100644 --- a/dpnp/dpnp_iface_histograms.py +++ b/dpnp/dpnp_iface_histograms.py @@ -477,10 +477,12 @@ def histogram(a, bins=10, range=None, density=None, weights=None): "supported types" ) - a_casted = a.astype(a_bin_dtype, order="C", copy=False) - bin_edges_casted = bin_edges.astype(a_bin_dtype, order="C", copy=False) + a_casted = dpnp.astype(a, a_bin_dtype, order="C", copy=False) + bin_edges_casted = dpnp.astype( + bin_edges, a_bin_dtype, order="C", copy=False + ) weights_casted = ( - weights.astype(hist_dtype, order="C", copy=False) + dpnp.astype(weights, hist_dtype, order="C", copy=False) if weights is not None else None ) @@ -516,7 +518,7 @@ def histogram(a, bins=10, range=None, density=None, weights=None): if usm_type != n_usm_type: n = dpnp.asarray(n_casted, dtype=ntype, usm_type=usm_type) else: - n = n_casted.astype(ntype, copy=False) + n = dpnp.astype(n_casted, ntype, copy=False) if density: # pylint: disable=possibly-used-before-assignment