8000 argmax( x, 0) on a single dimension array returns the wrong index · Issue #2752 · xtensor-stack/xtensor · GitHub
[go: up one dir, main page]

Skip to content 8000
argmax( x, 0) on a single dimension array returns the wrong index #2752
@SoundDev

Description

@SoundDev

The function xt::argmax(x, 0) returns the wrong index. Ran on Windows 10 with VS2023 v143 compiler.

        TEST_METHOD(NativeXTensor_ArgMax)
        {
            xt::xarray<int> a{ 0, 1, 2, 3, 4, -1};
            xt::xarray<int> res = xt::argmax(a, 0);
            // res[0] is 5
            Assert::AreEqual( 4, res[0]);
        }

The expected index is 4 that actual index is 5 that argmax() returns.
This seems simlar to xtensor issue #1487

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

      0