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

scalar zeros_like -> broadcast_to failure #513

Closed
crusaderky opened this issue Aug 26, 2021 · 0 comments
Closed

scalar zeros_like -> broadcast_to failure #513

crusaderky opened this issue Aug 26, 2021 · 0 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@crusaderky
Copy link
Contributor

xref pydata/xarray#5654 (comment)

sparse 0.12.0
numpy-1.20.1

>>> import sparse
>>> s = sparse.COO.from_numpy([0, 0, 1, 2])
>>> np.broadcast_to(np.zeros_like(s.todense(), shape=()), (3, ))
array([0, 0, 0])
>>> np.broadcast_to(np.zeros_like(s, shape=()), (3, ))
ValueError: The data length does not match the coordinates given.
len(data) = 0, but 3 coords specified.
@crusaderky crusaderky added the bug Indicates an unexpected problem or unintended behavior label Aug 26, 2021
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

No branches or pull requests

1 participant