-
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
Add MUL operator to relay tflite frontend #3304
Conversation
@@ -24,7 +24,6 @@ | |||
import numpy as np | |||
import tvm | |||
from tvm import relay | |||
from tvm.contrib import util |
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.
Import is not used. I deleted it
@@ -144,8 +143,6 @@ def compare_tflite_with_tvm(in_data, in_name, input_tensors, | |||
for i in range(len(tflite_output)): | |||
tvm.testing.assert_allclose(tflite_output[i], tvm_output[i], atol=1e-5, rtol=1e-5) | |||
|
|||
sess.close() |
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.
line 127 opens new with tf.Session() as sess:
context block.
After python finishes with tf.Session
block execution it callssess.__exit__()
method automatically which calls self.close()
to close the session.
We do not need to close sess
explicitly.
@srkreddy1238 @jroesch @FrozenGene Can you have a look? |
@kevinthesun please manage the PR |
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
MUL operator is used in TFLite SSD Resnet 50 model (ssd_resnet_50_fpn_coco).
Model graph: ssd_resnet_50_fpn_coco.tflite.pdf
This PR transforms existing
convert_add
method to generic_convert_elemwise
method (similar approach is used in tensorflow frontend code)Existing
convert_add
and newconvert_mul
methods use_convert_elemwise
method now.I also created
_test_elemwise
method based on existing_test_add
method.Both
_test_add
and_test_mul
use_test_elemwise
method now