Skip to content
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

np.outer and np.multiply.outer produce wrong result #346

Closed
hameerabbasi opened this issue May 16, 2020 · 1 comment · Fixed by #347
Closed

np.outer and np.multiply.outer produce wrong result #346

hameerabbasi opened this issue May 16, 2020 · 1 comment · Fixed by #347
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@hameerabbasi
Copy link
Collaborator

Describe the bug
The shape of the inputs np.outer and np.multiply.outer is incorrect.

To Reproduce

>>> import numpy as np, sparse
>>> s1 = sparse.random((2, 3), density=0.5)
>>> s2 = sparse.random((3, 2), density=0.5)
>>> sparse.outer(s1, s2).shape
(3, 2, 2, 3)
>>> np.outer(s1.todense(), s2.todense()).shape
(6, 6)
>>> np.multiply.outer(s1, s2).shape
(3, 2, 2, 3)
>>> np.multiply.outer(s1.todense(), s2.todense()).shape
(2, 3, 3, 2)

Expected behavior
The behavior should match NumPy.

System

  • OS and version: macOS 10.15.4
  • sparse version: '0.9.1+24.gf6b3465'
  • NumPy version: '1.18.1'
  • Numba version '0.49.1rc1'

Additional context
First noticed by @Prabhat-LIINES in #345. See: #345 (comment)

@hameerabbasi hameerabbasi added the bug Indicates an unexpected problem or unintended behavior label May 16, 2020
@hameerabbasi
Copy link
Collaborator Author

@Prabhat-LIINES if you pull from master this should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant