Commit 27e34ff2 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

fix review comments

parent 5fb6c7db
......@@ -45,9 +45,10 @@ struct argmax
for(std::size_t i = 1; i < item_num; ++i)
{
indices[axis] = i;
if(max_val < input(indices.begin(), indices.end()))
auto cur_val = input(indices.begin(), indices.end());
if(max_val < cur_val)
{
max_val = input(indices.begin(), indices.end());
max_val = cur_val;
max_index = i;
}
}
......
......@@ -50,9 +50,10 @@ struct argmin
for(std::size_t i = 1; i < item_num; ++i)
{
indices[axis] = i;
if(min_val > input(indices.begin(), indices.end()))
auto cur_val = input(indices.begin(), indices.end());
if(min_val > cur_val)
{
min_val = input(indices.begin(), indices.end());
min_val = cur_val;
min_index = i;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment