You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/04/30 13:20:58 UTC

[GitHub] [incubator-tvm] siju-samuel opened a new pull request #5486: [TFLITE]Select op support for tflite frontend

siju-samuel opened a new pull request #5486:
URL: https://github.com/apache/incubator-tvm/pull/5486


   Added the support of `select` op in tflite frontend.
   
   @FrozenGene @masahi please help me to review and merge this PR. TIA
   Note: tflite `where` op is same as `select` in tflite.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] siju-samuel commented on pull request #5486: [TFLITE]Select op support for tflite frontend

Posted by GitBox <gi...@apache.org>.
siju-samuel commented on pull request #5486:
URL: https://github.com/apache/incubator-tvm/pull/5486#issuecomment-624415336


   @FrozenGene could you please help to merge this PR. TIA


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] u99127 commented on a change in pull request #5486: [TFLITE]Select op support for tflite frontend

Posted by GitBox <gi...@apache.org>.
u99127 commented on a change in pull request #5486:
URL: https://github.com/apache/incubator-tvm/pull/5486#discussion_r420269543



##########
File path: python/tvm/relay/frontend/tflite.py
##########
@@ -109,16 +109,17 @@ def __init__(self, model, subgraph, exp_tab):
             'PAD': self.convert_pad,
             'POW': self.convert_pow,
             'PRELU': self.convert_prelu,
-            'REDUCE_ANY': self._convert_reduce_any,
-            'REDUCE_MAX': self._convert_reduce_max,
-            'REDUCE_MIN': self._convert_reduce_min,
-            'REDUCE_PROD': self._convert_reduce_prod,
+            'REDUCE_ANY': self.convert_reduce_any,
+            'REDUCE_MAX': self.convert_reduce_max,
+            'REDUCE_MIN': self.convert_reduce_min,
+            'REDUCE_PROD': self.convert_reduce_prod,
             'RELU':self.convert_relu,

Review comment:
       In an ideal world that would be a separate PR rather than merging it in here as that could just go in separately and pretty mechanically.
   
   However, that's really not our development practice yet. 
   
   Ramana




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] u99127 commented on a change in pull request #5486: [TFLITE]Select op support for tflite frontend

Posted by GitBox <gi...@apache.org>.
u99127 commented on a change in pull request #5486:
URL: https://github.com/apache/incubator-tvm/pull/5486#discussion_r419721738



##########
File path: python/tvm/relay/frontend/tflite.py
##########
@@ -109,16 +109,17 @@ def __init__(self, model, subgraph, exp_tab):
             'PAD': self.convert_pad,
             'POW': self.convert_pow,
             'PRELU': self.convert_prelu,
-            'REDUCE_ANY': self._convert_reduce_any,
-            'REDUCE_MAX': self._convert_reduce_max,
-            'REDUCE_MIN': self._convert_reduce_min,
-            'REDUCE_PROD': self._convert_reduce_prod,
+            'REDUCE_ANY': self.convert_reduce_any,
+            'REDUCE_MAX': self.convert_reduce_max,
+            'REDUCE_MIN': self.convert_reduce_min,
+            'REDUCE_PROD': self.convert_reduce_prod,
             'RELU':self.convert_relu,

Review comment:
       Why are these changes relevant to this Pull request ? 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] siju-samuel commented on a change in pull request #5486: [TFLITE]Select op support for tflite frontend

Posted by GitBox <gi...@apache.org>.
siju-samuel commented on a change in pull request #5486:
URL: https://github.com/apache/incubator-tvm/pull/5486#discussion_r419859922



##########
File path: python/tvm/relay/frontend/tflite.py
##########
@@ -109,16 +109,17 @@ def __init__(self, model, subgraph, exp_tab):
             'PAD': self.convert_pad,
             'POW': self.convert_pow,
             'PRELU': self.convert_prelu,
-            'REDUCE_ANY': self._convert_reduce_any,
-            'REDUCE_MAX': self._convert_reduce_max,
-            'REDUCE_MIN': self._convert_reduce_min,
-            'REDUCE_PROD': self._convert_reduce_prod,
+            'REDUCE_ANY': self.convert_reduce_any,
+            'REDUCE_MAX': self.convert_reduce_max,
+            'REDUCE_MIN': self.convert_reduce_min,
+            'REDUCE_PROD': self.convert_reduce_prod,
             'RELU':self.convert_relu,

Review comment:
       @u99127 for code consistency i changed, its not related to this PR. 
   This 5 methods were starting with `_` and i removed those. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] maheshambule commented on pull request #5486: [TFLITE]Select op support for tflite frontend

Posted by GitBox <gi...@apache.org>.
maheshambule commented on pull request #5486:
URL: https://github.com/apache/incubator-tvm/pull/5486#issuecomment-625091810


   > LGTM. @siju-samuel After thinking about this pr, I think we should make `get_expr` and `exp_tab.new_const` be private and only public `get_tensor_expr`. Other places use `get_expr` / `exp_tab.new_const` should be replaced as `get_tensor_expr`. Wish you could consider this suggestion after this pr.
   
   @FrozenGene, @siju-samuel, Considering this fix as part of this refactoring https://github.com/apache/incubator-tvm/pull/5528.
   
   Please let us know your opinions on other refactoring aspects as well.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] FrozenGene commented on pull request #5486: [TFLITE]Select op support for tflite frontend

Posted by GitBox <gi...@apache.org>.
FrozenGene commented on pull request #5486:
URL: https://github.com/apache/incubator-tvm/pull/5486#issuecomment-625080456


   LGTM. @siju-samuel After thinking about this pr, I think we should make `get_expr` and `exp_tab.new_const` be private and only public `get_tensor_expr`. Other places use `get_expr` / `exp_tab.new_const` should be replaced as `get_tensor_expr`. Wish you could consider this suggestion after this pr.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] FrozenGene commented on a change in pull request #5486: [TFLITE]Select op support for tflite frontend

Posted by GitBox <gi...@apache.org>.
FrozenGene commented on a change in pull request #5486:
URL: https://github.com/apache/incubator-tvm/pull/5486#discussion_r418114942



##########
File path: python/tvm/relay/frontend/tflite.py
##########
@@ -2357,6 +2371,20 @@ def get_expr(self, input_tensor_idx):
     def has_expr(self, input_tensor_idx):
         return self.exp_tab.has_expr(get_tensor_name(self.subgraph, input_tensor_idx))
 
+    def get_tensor_or_const_expr(self, tensor):

Review comment:
       This name is trick. Here, we want to get relay expr and distinguish const. However, const is also expr in fact. Maybe we could name it `get_tensor_expr`? Do you have any better suggestion?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] siju-samuel commented on pull request #5486: [TFLITE]Select op support for tflite frontend

Posted by GitBox <gi...@apache.org>.
siju-samuel commented on pull request #5486:
URL: https://github.com/apache/incubator-tvm/pull/5486#issuecomment-625084251


   > LGTM. @siju-samuel After thinking about this pr, I think we should make get_expr and exp_tab.new_const be private and only public get_tensor_expr. Other places use get_expr / exp_tab.new_const should be replaced as get_tensor_expr. Wish you could consider this suggestion after this pr.
   
   @FrozenGene Thanks. I will optimize all this and will do a PR. 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] FrozenGene commented on pull request #5486: [TFLITE]Select op support for tflite frontend

Posted by GitBox <gi...@apache.org>.
FrozenGene commented on pull request #5486:
URL: https://github.com/apache/incubator-tvm/pull/5486#issuecomment-625080689


   Thanks @siju-samuel @u99127 merged now.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-tvm] siju-samuel commented on a change in pull request #5486: [TFLITE]Select op support for tflite frontend

Posted by GitBox <gi...@apache.org>.
siju-samuel commented on a change in pull request #5486:
URL: https://github.com/apache/incubator-tvm/pull/5486#discussion_r420289173



##########
File path: python/tvm/relay/frontend/tflite.py
##########
@@ -109,16 +109,17 @@ def __init__(self, model, subgraph, exp_tab):
             'PAD': self.convert_pad,
             'POW': self.convert_pow,
             'PRELU': self.convert_prelu,
-            'REDUCE_ANY': self._convert_reduce_any,
-            'REDUCE_MAX': self._convert_reduce_max,
-            'REDUCE_MIN': self._convert_reduce_min,
-            'REDUCE_PROD': self._convert_reduce_prod,
+            'REDUCE_ANY': self.convert_reduce_any,
+            'REDUCE_MAX': self.convert_reduce_max,
+            'REDUCE_MIN': self.convert_reduce_min,
+            'REDUCE_PROD': self.convert_reduce_prod,
             'RELU':self.convert_relu,

Review comment:
       @u99127 Thanks for the review. I totally agree with you. I removed those changes as part of this PR. i will raise another PR[#5515] for those. Could you please check again. TIA. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org