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_r348923042
 
 

 ##########
 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:
   ```_infer_value_simulated``` will create dummy data if some variables don't 
appear in params. In data dependent case, this will cause problem.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to