ekalda commented on a change in pull request #9577:
URL: https://github.com/apache/tvm/pull/9577#discussion_r757019311



##########
File path: python/tvm/relay/backend/contrib/ethosu/te/unary_elementwise.py
##########
@@ -111,7 +112,11 @@ def unary_elementwise_compute(
         "rounding_mode": rounding_mode,
     }
 
-    operators = {"ABS": te.abs}
+    def clz_imp(inp):
+        # Assuming that it's a 32 bit int
+        return 32 - te.log2(inp)

Review comment:
       Yes, the `inp` can be negative, but for the operators we turn into 
`extern_calls` the actual correctness of the compute expression doesn't really 
matter since we will pass to the NPU the parameters of the operation, but no 
specifics about the actual compute. That's probably why a "close enough" 
operation is used here...




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to