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

Reducers (sum/any/all) convert axis to regular axis with keepdims=True #2609

Closed
jrueb opened this issue Aug 3, 2023 · 2 comments
Closed
Labels
wontfix This will not be worked on

Comments

@jrueb
Copy link
Contributor

jrueb commented Aug 3, 2023

Version of Awkward Array

2.3.1

Description and code to reproduce

import awkward as ak

x = ak.Array([[1]])
result = ak.any(x, axis=1, keepdims=True)

The second axis of the results should be variable-length, because the second axis of x is also variable-length. However, the result is fully regular. I observe the same with ak.sum (among others). This did not happen in awkward version 1.10.3.

@jrueb jrueb added the bug (unverified) The problem described would be a bug, but needs to be triaged label Aug 3, 2023
@agoose77
Copy link
Collaborator

agoose77 commented Aug 3, 2023

Yes, this is intentional; we know that the axis has length-one, so we add that information.Is this a problem for you?

#1943 (comment) provides some context on the history of this decision :)

@agoose77 agoose77 added wontfix This will not be worked on and removed bug (unverified) The problem described would be a bug, but needs to be triaged labels Aug 3, 2023
@agoose77 agoose77 changed the title Reduciers (sum/any/all) convert axis to regular axis with keepdims=True Reducers (sum/any/all) convert axis to regular axis with keepdims=True Aug 4, 2023
@jrueb
Copy link
Contributor Author

jrueb commented Aug 4, 2023

I noticed this issue because I was slicing using the now-regular array, which removes a dimension.
In this case, I will use ak.from_regular to make sure its variable-length again. Thanks.

@jrueb jrueb closed this as completed Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants