-
Notifications
You must be signed in to change notification settings - Fork 95
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
ReverseSequence op #1177
ReverseSequence op #1177
Conversation
… into reversesequence_op
Current implementation cannot handle variable sequence lengths
… into reversesequence_op
Codecov Report
@@ Coverage Diff @@
## develop #1177 +/- ##
===========================================
- Coverage 92.59% 92.59% -0.01%
===========================================
Files 431 432 +1
Lines 13877 13687 -190
===========================================
- Hits 12850 12673 -177
+ Misses 1027 1014 -13
Continue to review full report at Codecov.
|
src/onnx/parse_reversesequence.cpp
Outdated
instruction_ref s0; | ||
if(sequence_lens[b] > 1) | ||
{ | ||
s0 = info.add_instruction(make_op("slice", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like most of the fields for the operator are the same with slight variations. Maybe you can make a helper function add_slice()
where the starts and ends are modified for each call?
src/onnx/parse_reversesequence.cpp
Outdated
instruction_ref s0; | ||
if(sequence_lens[b] > 1) | ||
{ | ||
s0 = info.add_instruction(make_op("slice", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like most of the fields for the operator are the same with slight variations. Maybe you can make a helper function add_slice()
where the starts and ends are modified for each call?
test/onnx/onnx_test.cpp
Outdated
input); | ||
for(int b = 1; b < batch_size; ++b) | ||
{ | ||
auto s0 = mm->add_instruction(migraphx::make_op("slice", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same feedback as I mentioned in the parser.
test/onnx/onnx_test.cpp
Outdated
input); | ||
for(int b = 1; b < batch_size; ++b) | ||
{ | ||
auto s0 = mm->add_instruction(migraphx::make_op("slice", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same feedback as I mentioned in the parser.
… into reversesequence_op
Implements the ReverseSequence ONNX operator as a parser.