wweic commented on a change in pull request #4309: [Relay][Op][TF] Complete 
tensor array unstack with all ranks support
URL: https://github.com/apache/incubator-tvm/pull/4309#discussion_r345391397
 
 

 ##########
 File path: python/tvm/relay/frontend/tensorflow.py
 ##########
 @@ -1070,9 +1071,13 @@ def _impl(inputs, attr, params):
 def _range():
     def _impl(inputs, attr, params):
         start = _get_param(params, inputs[0])[0]
-        limit = _get_param(params, inputs[1])[0] \
-            if hasattr(inputs[1], "name_hint") or isinstance(inputs[1], 
_expr.Constant) \
-            else params.pop('Rank').asnumpy()[0]
+        if hasattr(inputs[1], "name_hint") or isinstance(inputs[1], 
_expr.Constant):
+            limit = _get_param(params, inputs[1])[0]
+        else:
+            if any(['Rank' in param for param in params]):
+                limit = params.pop('Rank').asnumpy()[0]
+            else:
+                limit = _infer_value_simulated(inputs[1], params).asnumpy()[0]
 
 Review comment:
   @soiferj Thank you! I thought about it a bit, it doesn't seem to relate to 
my pr though the fix looks similar. We can definitely send another pr to fix 
later. I'd suggest we keep the pr single purpose. What do you think?

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