We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug When the input tensor has all-negative elements, like [-3, -1, -7], the matx::argmax returns weird index.
[-3, -1, -7]
matx::argmax
To Reproduce
#include <matx.h> int main() { // Create a tensor with all negative elements auto t = matx::make_tensor<float, 1>({3}); t.SetVals({-3, -1, -7}); t.Print(); // Apply matx::argmax matx::tensor_t<float, 0> max_val{}; matx::tensor_t<matx::index_t, 0> max_idx{}; matx::argmax(max_val, max_idx, t); max_val.Print(); max_idx.Print(); return 0; }
Output:
000000: -3.0000e+00 000001: -1.0000e+00 000002: -7.0000e+00 1.1755e-38 9223372036854775807
The max_val is 1.1755e-38 and max_idx is 9223372036854775807 which make no sense.
max_val
1.1755e-38
max_idx
9223372036854775807
Expected behavior The max_val should be -1 and max_idx should be 1.
-1
1
System details (please complete the following information):
The text was updated successfully, but these errors were encountered:
Hi @ZJUGuoShuai this has been fixed. Sorry for the delay.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Describe the bug
When the input tensor has all-negative elements, like
[-3, -1, -7]
, thematx::argmax
returns weird index.To Reproduce
Output:
The
max_val
is1.1755e-38
andmax_idx
is9223372036854775807
which make no sense.Expected behavior
The
max_val
should be-1
andmax_idx
should be1
.System details (please complete the following information):
The text was updated successfully, but these errors were encountered: