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/11/23 06:32:19 UTC

[GitHub] [incubator-tvm] alter-xp opened a new pull request #6949: [TF frontend] add support for StridedSlice to input a single constant

alter-xp opened a new pull request #6949:
URL: https://github.com/apache/incubator-tvm/pull/6949


   
   
   @giuseros @siju-samuel
   


----------------------------------------------------------------
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] giuseros commented on a change in pull request #6949: [TF frontend] add support for StridedSlice to input a single constant

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



##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -1599,6 +1599,9 @@ def _impl(inputs, attr, params, mod):
         data_shape = get_const_tuple(in_type.checked_type.shape)
         data_dim = len(data_shape)
         stride_dim = len(stride)
+        if data_dim == 0 and isinstance(inputs[0], _expr.Constant):

Review comment:
       I suspect this is `data_dim==1`, right? Otherwise, the data would just be empty. Also, could you add a test case  to check this situation? In general, every new feature should come with an appropriate test (see the guidelines : https://tvm.apache.org/docs/contribute/pull_request.html)




----------------------------------------------------------------
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] alter-xp commented on a change in pull request #6949: [TF frontend] add support for StridedSlice to input a single constant

Posted by GitBox <gi...@apache.org>.
alter-xp commented on a change in pull request #6949:
URL: https://github.com/apache/incubator-tvm/pull/6949#discussion_r529162488



##########
File path: python/tvm/relay/frontend/tensorflow.py
##########
@@ -1599,6 +1599,9 @@ def _impl(inputs, attr, params, mod):
         data_shape = get_const_tuple(in_type.checked_type.shape)
         data_dim = len(data_shape)
         stride_dim = len(stride)
+        if data_dim == 0 and isinstance(inputs[0], _expr.Constant):

Review comment:
       Maybe I didn't describe it clearly, the input here is a single number. So `data_dim` here is 0. This situation is the same as `np.array(1)`. `len(np.array(1).shape) == 0`




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