Skip to content

Commit

Permalink
call dpnp.kron and dpnp.dot for special cases in dpnp_matmul (#…
Browse files Browse the repository at this point in the history
…1815)

* reorganize the structure of dpnp_matmul function

reorganizing for easier future code development
calling dpnp.kron and dpnp.dot for special cases in dpnp.matmul

* address comments

* improve coverage

* fix pre-commit

---------

Co-authored-by: Anton <100830759+antonwolfy@users.noreply.github.com>
  • Loading branch information
vtavana and antonwolfy authored May 14, 2024
1 parent 362a73a commit e1dcc45
Show file tree
Hide file tree
Showing 6 changed files with 347 additions and 178 deletions.
2 changes: 2 additions & 0 deletions dpnp/dpnp_iface_histograms.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def _get_bin_edges(a, bins, range, usm_type):
# numpy's gh-10322 means that type resolution rules are dependent on
# array shapes. To avoid this causing problems, we pick a type now and
# stick with it throughout.
# pylint: disable=possibly-used-before-assignment
bin_type = dpnp.result_type(first_edge, last_edge, a)
if dpnp.issubdtype(bin_type, dpnp.integer):
bin_type = dpnp.result_type(
Expand Down Expand Up @@ -332,6 +333,7 @@ def histogram(a, bins=10, range=None, density=None, weights=None):

if density:
db = dpnp.diff(bin_edges).astype(dpnp.default_float_type())
# pylint: disable=possibly-used-before-assignment
return n / db / n.sum(), bin_edges

return n, bin_edges
Loading

0 comments on commit e1dcc45

Please sign in to comment.