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

ak.argmax doesn't produce correct result for inner axis with nonzero start #1000

Closed
agoose77 opened this issue Jul 14, 2021 · 1 comment · Fixed by #1001
Closed

ak.argmax doesn't produce correct result for inner axis with nonzero start #1000

agoose77 opened this issue Jul 14, 2021 · 1 comment · Fixed by #1001
Labels
bug (unverified) The problem described would be a bug, but needs to be triaged

Comments

@agoose77
Copy link
Collaborator

agoose77 commented Jul 14, 2021

Version of Awkward Array

1.4.0

Description and code to reproduce

This is possibly related to #998 , but I wanted to open a new issue in case it is not.

Given this reproducer, the result loses certain elements

import awkward as ak
import numpy as np

array = ak.Array(
    ak.layout.ListOffsetArray64(
        ak.layout.Index64(np.r_[1, 3, 5]),
        ak.layout.ListOffsetArray64(
            ak.layout.Index64(np.r_[0, 3, 5, 8, 10, 12]),
            ak.layout.NumpyArray(
                np.r_[
                    1.8125,###
                    0.81252,###
                    -0.937,###

                    6.0,
                    -0.6875,

                    1.3125,
                    21.3125,
                    4.0,

                    9.8,
                    2.2,

                    33.0,
                    44.6,
                ]
            ),
        )
    )
)
assert ak.to_list(ak.argmax(array, axis=1)) == [[0, 1, 1], [1, 1]]
@agoose77 agoose77 added the bug (unverified) The problem described would be a bug, but needs to be triaged label Jul 14, 2021
@jpivarski
Copy link
Member

Issue 1000! 🎉

I'll be looking at the issues and PRs associated with nonzero starts soon. It's probably related to the code I was looking at last night.

jpivarski added a commit that referenced this issue Jul 14, 2021
…Also optimizes toListOffsetArray64(true).
jpivarski added a commit that referenced this issue Jul 14, 2021
…Also optimizes toListOffsetArray64(true). (#1001)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug (unverified) The problem described would be a bug, but needs to be triaged
Projects
None yet
2 participants