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 2022/01/17 14:33:04 UTC

[GitHub] [tvm] manupa-arm commented on a change in pull request #9794: [microNPU] Add support for scalar values

manupa-arm commented on a change in pull request #9794:
URL: https://github.com/apache/tvm/pull/9794#discussion_r786059348



##########
File path: python/tvm/relay/backend/contrib/ethosu/tir/scheduler.py
##########
@@ -135,7 +135,17 @@ def _visit(tensor, reader, lut):
             if tensor not in planned:
                 planned.add(tensor)
                 if isinstance(tensor.op, tvm.te.PlaceholderOp) and tensor != lut:
-                    index = list(cached_func.inputs).index(tensor)
+                    # Find index of input using 'same_as' check to prevent equality
+                    # ambiguity when encountering a scalar.
+                    index = -1
+                    for i, var in enumerate(cached_func.inputs):

Review comment:
       nit : could use something like : 
   [input for input in cached_func.inputs if input.same_as(tensor)] and then checking the resulting list ?




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

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org