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

[ONNX][TOPI] Support select_last_index for argmin/max #8816

Merged
merged 53 commits into from
Aug 31, 2021
Merged
Changes from 1 commit
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
53d5ada
support select_last_index for argmin/max
AndrewZhaoLuo Aug 23, 2021
95a6517
reverse conditions which made on accident
AndrewZhaoLuo Aug 23, 2021
5e1f06a
forward args in reduce.py
AndrewZhaoLuo Aug 23, 2021
962e38a
make proper nodes for reduction ops
AndrewZhaoLuo Aug 23, 2021
f92089b
remove complicated nested lambdas
AndrewZhaoLuo Aug 23, 2021
9edc8e6
fix lambda capture for conversion
AndrewZhaoLuo Aug 23, 2021
9e4e69a
forward more arguments
AndrewZhaoLuo Aug 23, 2021
5cf4772
forward more args
AndrewZhaoLuo Aug 23, 2021
4f5a662
enable onnx tests
AndrewZhaoLuo Aug 23, 2021
75cb608
wrapping casts to remove ambiguity
Aug 24, 2021
7a60353
revert changes extraneous
AndrewZhaoLuo Aug 24, 2021
6a9e82f
correct incorrect attrs being used for ops
AndrewZhaoLuo Aug 24, 2021
0fb5db5
change attributes
AndrewZhaoLuo Aug 24, 2021
55a412d
remove old impl
Aug 24, 2021
93173fc
register new attribute node
AndrewZhaoLuo Aug 24, 2021
47b7eed
clean up test
AndrewZhaoLuo Aug 24, 2021
e62513b
reformat
AndrewZhaoLuo Aug 24, 2021
e9ea784
reformat
AndrewZhaoLuo Aug 24, 2021
587e94a
coolio
AndrewZhaoLuo Aug 24, 2021
d048e25
stable comparison
AndrewZhaoLuo Aug 24, 2021
71ab1f3
casts to avoid ambiguity
AndrewZhaoLuo Aug 24, 2021
aecf630
casting more
AndrewZhaoLuo Aug 24, 2021
423d092
correct arg passing
AndrewZhaoLuo Aug 26, 2021
2faf06d
support select_last_index for argmin/max
AndrewZhaoLuo Aug 23, 2021
edbc0f1
reverse conditions which made on accident
AndrewZhaoLuo Aug 23, 2021
ba7f57c
forward args in reduce.py
AndrewZhaoLuo Aug 23, 2021
dbf6dc1
make proper nodes for reduction ops
AndrewZhaoLuo Aug 23, 2021
fa4dd43
remove complicated nested lambdas
AndrewZhaoLuo Aug 23, 2021
78cc734
fix lambda capture for conversion
AndrewZhaoLuo Aug 23, 2021
0979f4d
forward more arguments
AndrewZhaoLuo Aug 23, 2021
647413e
forward more args
AndrewZhaoLuo Aug 23, 2021
f694e58
enable onnx tests
AndrewZhaoLuo Aug 23, 2021
576c56b
wrapping casts to remove ambiguity
Aug 24, 2021
67b5762
revert changes extraneous
AndrewZhaoLuo Aug 24, 2021
6d59d1c
correct incorrect attrs being used for ops
AndrewZhaoLuo Aug 24, 2021
d7a595f
change attributes
AndrewZhaoLuo Aug 24, 2021
6b645de
remove old impl
Aug 24, 2021
0faf5b6
register new attribute node
AndrewZhaoLuo Aug 24, 2021
96d85c2
clean up test
AndrewZhaoLuo Aug 24, 2021
8a6a4bc
reformat
AndrewZhaoLuo Aug 24, 2021
29a2660
reformat
AndrewZhaoLuo Aug 24, 2021
3a2a38d
coolio
AndrewZhaoLuo Aug 24, 2021
296ac2e
stable comparison
AndrewZhaoLuo Aug 24, 2021
12f7213
casts to avoid ambiguity
AndrewZhaoLuo Aug 24, 2021
20cdd36
casting more
AndrewZhaoLuo Aug 24, 2021
49b6322
correct arg passing
AndrewZhaoLuo Aug 26, 2021
fcc420e
Merge branch 'aluo/onnx/argmin_and_argmax' of github.com:AndrewZhaoLu…
AndrewZhaoLuo Aug 27, 2021
8f37f89
fix broken input
AndrewZhaoLuo Aug 27, 2021
2db29ca
OneElementReduceAttrs-->ArgReduceAttrs"
Aug 30, 2021
4055190
reduce boilerplate
Aug 30, 2021
1f56147
change names
Aug 30, 2021
d4cbfcc
remove log statement
Aug 30, 2021
c5f308b
jostle ci
AndrewZhaoLuo Aug 31, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
casts to avoid ambiguity
  • Loading branch information
AndrewZhaoLuo authored and Andrew Zhao Luo committed Aug 27, 2021
commit 12f7213248d5cf7083b49f0acaf6a5ab7f1bd078
8 changes: 4 additions & 4 deletions include/tvm/topi/reduction.h
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,9 @@ inline FCommReduce MakeArgminReducer(bool select_last_index = false) {
// indices if not select_last_index;
PrimExpr proper_index;
if (select_last_index) {
proper_index = lhs[0] > rhs[0];
proper_index = PrimExpr(lhs[0]) > PrimExpr(rhs[0]);
} else {
proper_index = lhs[0] < rhs[0];
proper_index = PrimExpr(lhs[0]) < PrimExpr(rhs[0]);
}

PrimExpr update_index = is_smaller || (is_same && proper_index);
Expand Down Expand Up @@ -500,9 +500,9 @@ inline FCommReduce MakeArgmaxReducer(bool select_last_index = false) {
// indices if not select_last_index;
PrimExpr proper_index;
if (select_last_index) {
proper_index = lhs[0] > rhs[0];
proper_index = PrimExpr(lhs[0]) > PrimExpr(rhs[0]);
} else {
proper_index = lhs[0] < rhs[0];
proper_index = PrimExpr(lhs[0]) < PrimExpr(rhs[0]);
}

PrimExpr update_index = is_bigger || (is_same && proper_index);
Expand Down