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/19 21:36:27 UTC

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

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

 ##########
 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 think `_infer_value_simulated` is better here. `_infer_value` assumes that all of the inputs leading up to `inputs[1]` are constant, `_infer_value_simulated` does not.

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