-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Relay][Frontend][TFLite] transpose implementation for tflite.py #3705
Conversation
Hi, thanks for contribution! For the TFLite frontend, I think you could use For your PR, besides For GitHub CI, when it is red, you could click ************* Module tvm.relay.frontend.tflite
E:767,18: Unexpected keyword argument 'axis' in function call (unexpected-keyword-arg)
E:769,18: Unexpected keyword argument 'axis' in function call (unexpected-keyword-arg) So, After you have done it, you could make one new pr, we could discuss and review it again. Thanks. |
ccf91cc
to
1147371
Compare
Hi @FrozenGene Thanks for your kindly reply and It's really help me to do this work. I update the implementation of transpose operator and also add unittest. |
python/tvm/relay/frontend/tflite.py
Outdated
input_tensor_idx = input_tensor.tensor_idx | ||
|
||
in_expr = self.get_expr(input_tensor_idx) | ||
out = _op.transpose(data=in_expr) |
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.
You omit the parameter of axes
, which is input_tensors[1]
of transpose
.
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.
Hi @FrozenGene
Thanks for reminding, I update the code for the parameter of axes and add new test case
1147371
to
28f7f4e
Compare
python/tvm/relay/frontend/tflite.py
Outdated
# axis | ||
in_axis = tuple(self.get_tensor_value(input_tensors[1])) | ||
|
||
if in_axis is None: |
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.
Could we have the condition in_axis
be None? I think we will never meet this condition. Because we construct it using tuple constructor. The bad case should be ()
in my opinion. Could you check the code here again and write one unit test to cover?
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.
Thanks for reviewing. I improve the condition and add one unit test to cover empty tuple.
28f7f4e
to
06e264a
Compare
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.
LGTM. Thanks.
@kevinthesun @yzhliu @tqchen @srkreddy1238 could anybody help to manage it? |
06e264a
to
2bea7a3
Compare
Hi @icemelon9 @zhiics Could you help to review/merge the PR? many thanks, |
Thanks @cchung100m @FrozenGene. This is now merged. |
…che#3705) * transpose implementation for tflite.py * add TRANSPOSE to convert_map * Fix Unexpected keyword argument 'axis' in function call * add test for transpose oprator * Add the parameter 'axes' handling * add test for transpose oprator * solve conflict within CONTRIBUTORS.md * Improve the if condition for empty tuple * Add one unit test to cover empty tuple * solve conflict within CONTRIBUTORS.md
…che#3705) * transpose implementation for tflite.py * add TRANSPOSE to convert_map * Fix Unexpected keyword argument 'axis' in function call * add test for transpose oprator * Add the parameter 'axes' handling * add test for transpose oprator * solve conflict within CONTRIBUTORS.md * Improve the if condition for empty tuple * Add one unit test to cover empty tuple * solve conflict within CONTRIBUTORS.md
…che#3705) * transpose implementation for tflite.py * add TRANSPOSE to convert_map * Fix Unexpected keyword argument 'axis' in function call * add test for transpose oprator * Add the parameter 'axes' handling * add test for transpose oprator * solve conflict within CONTRIBUTORS.md * Improve the if condition for empty tuple * Add one unit test to cover empty tuple * solve conflict within CONTRIBUTORS.md
Hi @FrozenGene
I am a newbie to tvm and trying to do some contribution for frontend and relay. This is my first time to add the missing operator for tflite, I would appreciate if you can guide me how to go through it :)
Many thanks,