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

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


Reply via email to