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/12 01:39:03 UTC

[GitHub] [incubator-tvm] soiferj commented on a change in pull request #4309: [Relay][Op][TF] Complete tensor array unstack with all ranks support

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

 ##########
 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:
   Thanks a lot for adding this. While you're here, would you mind adding the fix to `_transpose()` too?
   
   ```
   ...
   except (IndexError, KeyError):
       axes = _infer_value_simulated(inputs[1], params)
   ```

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