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 2021/12/20 16:34:24 UTC

[GitHub] [tvm] jacobbohlin commented on a change in pull request #9469: [microNPU][2a] Add CascaderGraph for cascading analysis

jacobbohlin commented on a change in pull request #9469:
URL: https://github.com/apache/tvm/pull/9469#discussion_r772509046



##########
File path: src/contrib/ethosu/cascader/common.h
##########
@@ -103,6 +119,18 @@ inline std::size_t hash_vector(const std::vector<T>& vec) {
   return seed;
 }
 
+template <class T>
+inline T mul_reduce(const std::vector<T>& vec) {
+  if (vec.size() == 0) {
+    return 0;
+  }
+  T v = vec[0];
+  for (unsigned int i = 1; i < vec.size(); i++) {
+    v *= vec[i];
+  }
+  return v;
+}

Review comment:
       Minor suggestion but you could use instead of this template.
   ```C++
   std::accumulate(vec.begin(),vec.end(), 1, std::multiplies<T>());
   ```




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