tlopex commented on code in PR #19683:
URL: https://github.com/apache/tvm/pull/19683#discussion_r3375986703


##########
include/tvm/topi/reduction.h:
##########
@@ -184,7 +184,9 @@ inline Tensor DoCommReduce(const Tensor& data, FReduce func,
 inline Tensor CommReduce(const Tensor& data, const 
ffi::Optional<ffi::Array<int64_t>>& axis,
                          FReduce func, bool keepdims, bool atleast1d) {
   auto ndim = data->shape.size();
-  TVM_FFI_ICHECK_NE(ndim, 0) << "Cannot reduce a 0 dim Tensor";
+  if (ndim == 0) {
+    return topi::identity(data, data->op->name + "_red", kCommReduce);
+  }

Review Comment:
   this makes sense. could you have a look?



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to