Skip to content

Commit

Permalink
Fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderKalistratov committed Sep 17, 2024
1 parent 088beb5 commit 020ea2c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions dpnp/backend/extensions/sycl_ext/histogram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@
#include <unordered_map>
#include <vector>

// dpctl tensor headers
#include "utils/type_dispatch.hpp"
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

// dpctl tensor headers
#include "dpctl4pybind11.hpp"
#include "utils/type_dispatch.hpp"

#include "histogram.hpp"
#include "histogram_common.hpp"

Expand Down
10 changes: 6 additions & 4 deletions dpnp/dpnp_iface_histograms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 020ea2c

Please sign in to comment.