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 2019/11/20 19:14:41 UTC

[GitHub] [incubator-tvm] kevinthesun commented on a change in pull request #4372: [Relay][Frontend][TF] Fix slice when begin or size is not Const

kevinthesun commented on a change in pull request #4372: [Relay][Frontend][TF] Fix slice when begin or size is not Const
URL: https://github.com/apache/incubator-tvm/pull/4372#discussion_r348695256
 
 

 ##########
 File path: python/tvm/relay/frontend/tensorflow.py
 ##########
 @@ -626,8 +626,14 @@ def _impl(inputs, attr, params):
 
 def _slice():
     def _impl(inputs, attr, params):
-        begin = _get_list_param(params, inputs[1])
-        size = _get_list_param(params, inputs[2])
+        try:
+            begin = _get_list_param(params, inputs[1])
+        except:
+            begin = _infer_value_simulated(inputs[1], params).asnumpy()[0]
 
 Review comment:
   I'm not sure whether ```_infer_value_simulated``` should be used here. size parameter can be a data dependent expression. If we want to infer the correct value, probably we should enforce all variables in params. For symbolic begin/size slice, it will be covered in https://github.com/apache/incubator-tvm/pull/4312.

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


With regards,
Apache Git Services