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

Reductions on ArraySymbols do not handle empty and length 1 arrays #43

Closed
arcondello opened this issue Jul 4, 2024 · 1 comment · Fixed by #44
Closed

Reductions on ArraySymbols do not handle empty and length 1 arrays #43

arcondello opened this issue Jul 4, 2024 · 1 comment · Fixed by #44
Labels
bug Something isn't working

Comments

@arcondello
Copy link
Member

For example, currently

>>> model.constant([]).all()
...
ValueError: cannot do a reduction on an empty array with an operation that has no identity without supplying an initial value

but we'd like it to follow NumPy

>>> np.asarray([]).all()
True
@arcondello arcondello added the bug Something isn't working label Jul 4, 2024
@arcondello
Copy link
Member Author

Looks like it was only All that was missing the initial value. And length-1 works for all. #44 adds tests for the rest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant