FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

`argmax` with axis return argmin in 0.24.2 if expression dimension == 1 · Issue #2550 · xtensor-stack/xtensor · GitHub

Repository navigation

argmax with axis return argmin in 0.24.2 if expression dimension == 1 #2550

Open

Description

Minimal code to reproduce:

#include <iostream>

#include <xtensor/xtensor.hpp>
#include <xtensor/xsort.hpp>

int main() {
    xt::xtensor<double, 1> xtest{0, 1, 2, 3, 4};

    std::cout << xt::argmax(xtest)(0) << std::endl;
    std::cout << xt::argmax(xtest, 0)(0) << std::endl;


    return 0;
}

0.24.1 output:

4
4

0.24.2 output:

4
0

With the debugger I noticed that the compare function is ignored if dimension is 1 and an argmin implementation is called:

Activity

  1. tdegeus commented on Jul 26, 2022

    Member

    Thanks for reporting. This is clearly a bug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL