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/07/29 17:44:43 UTC

[GitHub] [incubator-tvm] d-smirnov opened a new pull request #6168: Gather operation with indices as tensor expr in TFLite frontend

d-smirnov opened a new pull request #6168:
URL: https://github.com/apache/incubator-tvm/pull/6168


   This PR adds handling of indices as tensor expr to "gather" operation in TFLite frontend. Also the code checking out of boundary error refactored in slightly more "pythonic" way. Fixed bug in negative axis value normalisation


----------------------------------------------------------------
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] anijain2305 commented on pull request #6168: Gather operation with indices as tensor expr in TFLite frontend

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


   Thanks @siju-samuel @d-smirnov This is merged!


----------------------------------------------------------------
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] anijain2305 merged pull request #6168: Gather operation with indices as tensor expr in TFLite frontend

Posted by GitBox <gi...@apache.org>.
anijain2305 merged pull request #6168:
URL: https://github.com/apache/incubator-tvm/pull/6168


   


----------------------------------------------------------------
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 #6168: Gather operation with indices as tensor expr in TFLite frontend

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



##########
File path: python/tvm/relay/frontend/tflite.py
##########
@@ -1321,14 +1321,15 @@ def convert_gather(self, op):
         input_tensors = self.get_input_tensors(op)
         assert len(input_tensors) == 2, "input tensors length should be 2"
 
-        data = self.get_expr(input_tensors[0].tensor_idx)
-
+        if self.has_expr(input_tensors[0].tensor_idx):
+            data = self.get_expr(input_tensors[0].tensor_idx)
+        else:
+            data = self.exp_tab.new_const(self.get_tensor_value(input_tensors[0]),
+                                          dtype=self.get_tensor_type_str(input_tensors[0]\
+                                                                         .tensor.Type()))

Review comment:
       suggested to use `get_tensor_expr` for this code.




----------------------------------------------------------------
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] d-smirnov commented on a change in pull request #6168: Gather operation with indices as tensor expr in TFLite frontend

Posted by GitBox <gi...@apache.org>.
d-smirnov commented on a change in pull request #6168:
URL: https://github.com/apache/incubator-tvm/pull/6168#discussion_r469886837



##########
File path: python/tvm/relay/frontend/tflite.py
##########
@@ -1321,14 +1321,15 @@ def convert_gather(self, op):
         input_tensors = self.get_input_tensors(op)
         assert len(input_tensors) == 2, "input tensors length should be 2"
 
-        data = self.get_expr(input_tensors[0].tensor_idx)
-
+        if self.has_expr(input_tensors[0].tensor_idx):
+            data = self.get_expr(input_tensors[0].tensor_idx)
+        else:
+            data = self.exp_tab.new_const(self.get_tensor_value(input_tensors[0]),
+                                          dtype=self.get_tensor_type_str(input_tensors[0]\
+                                                                         .tensor.Type()))

Review comment:
       Done




----------------------------------------------------------------
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