kevinthesun commented on a change in pull request #6729:
URL: https://github.com/apache/incubator-tvm/pull/6729#discussion_r510334008



##########
File path: include/tvm/topi/transform.h
##########
@@ -897,8 +897,14 @@ inline Tensor where(const Tensor& condition, const Tensor& 
x, const Tensor& y,
     return compute(
         condition->shape,
         [&](const Array<Var>& indices) {
-          Array<PrimExpr> condition_idx{indices[0]};
-          return tvm::tir::Select(condition(condition_idx) != 0, x(), y());
+          PrimExpr cond;
+          if (condition->shape.size() == 0) {
+            cond = condition();

Review comment:
       No. cond is a scalar.




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

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


Reply via email to