yongwww 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_r348778651
##########
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 ` is not able to handle data dependent cases. Let's
use `_infer_value` here, if `_infer_value` doesn't help, then we have to use
dynamic strided_slice in pr 4312. @lsy643 let us know if `_infer_value`
doesn't work for you
----------------------------------------------------------------
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