Skip to content

Improve logic of dpnp.outer() #1239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 1, 2022

Conversation

antonwolfy
Copy link
Contributor

@antonwolfy antonwolfy commented Nov 18, 2022

As was reported in issue #1203, dpnp.outer() is falling back on numpy call. This is because DPNP called multiplication function in a loop per each pair of elements from input vectors. While dpnp.__mul__() is falling on numpy if an input argument is a scalar.

The PR is intended to improve dpnp.outer() logic. It can be enough to invoke dpnp.__mul__() only once with both arguments as dpnp_array, instead of the looping over the elements.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • If this PR is a work in progress, are you filing the PR as a draft?

@antonwolfy antonwolfy self-assigned this Nov 18, 2022
@antonwolfy antonwolfy changed the title Improve outer method Improve logic of dpnp.outer() Nov 18, 2022
@antonwolfy antonwolfy merged commit 0876932 into IntelPython:master Dec 1, 2022
@antonwolfy antonwolfy deleted the outer_with_two_vectors branch December 1, 2022 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants